home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume12 / acm / part02 < prev    next >
Encoding:
Internet Message Format  |  1991-03-01  |  59.1 KB

  1. From: riley@mipsdal.mips.com (Riley Rainey)
  2. Newsgroups: comp.sources.x
  3. Subject: v12i007: acm - X aerial combat simulation, Part02/09
  4. Message-ID: <8984@exodus.Eng.Sun.COM>
  5. Date: 2 Mar 91 08:32:13 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: riley@mipsdal.mips.com (Riley Rainey)
  9. Posting-number: Volume 12, Issue 7
  10. Archive-name: acm/part02
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 2 (of 9)."
  19. # Contents:  acm/V/lib/VClipPoly.c acm/V/lib/VGetEyeSpace.c
  20. #   acm/V/lib/VOpenVp.c acm/V/test/f acm/V/test/f16 acm/V/test/mig23
  21. #   acm/fsim/Imakefile acm/fsim/acm.c acm/fsim/damage.c
  22. #   acm/fsim/eng.xbm acm/fsim/exp.xbm acm/fsim/exp1.xbm acm/fsim/f16
  23. #   acm/fsim/flaps.c acm/fsim/flaps1.xbm acm/fsim/init.c
  24. #   acm/fsim/mig23 acm/fsim/missileCalc.c acm/fsim/panel.c
  25. # Wrapped by riley@mipsdal on Thu Feb 14 10:09:17 1991
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'acm/V/lib/VClipPoly.c' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'acm/V/lib/VClipPoly.c'\"
  29. else
  30. echo shar: Extracting \"'acm/V/lib/VClipPoly.c'\" \(2128 characters\)
  31. sed "s/^X//" >'acm/V/lib/VClipPoly.c' <<'END_OF_FILE'
  32. X#include "Vlib.h"
  33. X
  34. XVPolygon * _VClipPolygon (poly, clipPlane)
  35. XVPolygon *poly;
  36. XVPoint     *clipPlane; {
  37. X
  38. X    register    int j, lastj, numPts = 0, clipped = 0;
  39. X    double    d1, d2, a;
  40. X    VPoint    tmpPoint[64];
  41. X    VPolygon    *p;
  42. X
  43. X    if (poly->numVtces > 0) {
  44. X
  45. X        lastj = poly->numVtces-1;
  46. X        d1 = VDotProd(&(poly->vertex[poly->numVtces-1]), clipPlane);
  47. X        numPts = 0;
  48. X
  49. X/*
  50. X *  Examine each vertex and determine if it is inside or outside of the
  51. X *  specified clipping plane.
  52. X */
  53. X
  54. X        for (j=0; j<poly->numVtces; ++j) {
  55. X
  56. X/* Leading vertex inside? */
  57. X
  58. X        if (d1 > 0.0)
  59. X            tmpPoint[numPts++] = poly->vertex[lastj];
  60. X
  61. X        d2 = VDotProd(&(poly->vertex[j]), clipPlane);
  62. X
  63. X/* Does the edge straddle the window? If so, add a vertex on the window */
  64. X
  65. X        if (d1 * d2 < 0.0) {
  66. X            clipped = 1;
  67. X            a = d1 / (d1 - d2);
  68. X            tmpPoint[numPts].x = a * poly->vertex[j].x +
  69. X                (1.0 - a) * poly->vertex[lastj].x;
  70. X            tmpPoint[numPts].y = a * poly->vertex[j].y +
  71. X                (1.0 - a) * poly->vertex[lastj].y;
  72. X            tmpPoint[numPts++].z = a * poly->vertex[j].z +
  73. X                (1.0 - a) * poly->vertex[lastj].z;
  74. X        }
  75. X
  76. X        lastj = j;
  77. X        d1 = d2;
  78. X        }
  79. X    }
  80. X
  81. X/*
  82. X *  If the polygon was completely out of bounds, delete this polygon.
  83. X */
  84. X
  85. X    if (numPts == 0) {
  86. X    p = (VPolygon *) NULL;
  87. X    VDestroyPolygon (poly);
  88. X#ifdef DEBUG
  89. X    fprintf (stderr, "VClipPolygon: polygon outside area of interest\n");
  90. X#endif
  91. X    }
  92. X
  93. X/*
  94. X *  If we did any clipping, return the clipped polygon.
  95. X */
  96. X
  97. X    else if (clipped != 0) {
  98. X    p = VCreatePolygon(numPts, &tmpPoint[0], poly->color);
  99. X#ifdef DEBUG
  100. X    fprintf (stderr, "VClipPolygon: Polygon has been clipped:\n");
  101. X    fprintf (stderr, "Before Clipping:\n");
  102. X    VPrintPolygon (stderr, poly);
  103. X    fprintf (stderr, "\nAfter Clipping:\n\n");
  104. X    VPrintPolygon (stderr, p);
  105. X#endif
  106. X    VDestroyPolygon (poly);
  107. X    }
  108. X    else
  109. X    p = poly;
  110. X
  111. X    return p;
  112. X}
  113. X
  114. XVPolygon * VClipPolygon (poly, clipPoly)
  115. XVPolygon *poly, *clipPoly; {
  116. X
  117. X    int     i;
  118. X    VPolygon     *p = poly;
  119. X
  120. X/*
  121. X *  Clip against each clipping plane supplied, one at a time.
  122. X */
  123. X
  124. X    for (i=0; i<clipPoly->numVtces; ++i) {
  125. X
  126. X    if (p == (VPolygon *) NULL)
  127. X        break;
  128. X
  129. X    p = _VClipPolygon (p, &(clipPoly->vertex[i]));
  130. X
  131. X    }
  132. X
  133. X    return p;
  134. X}
  135. END_OF_FILE
  136. if test 2128 -ne `wc -c <'acm/V/lib/VClipPoly.c'`; then
  137.     echo shar: \"'acm/V/lib/VClipPoly.c'\" unpacked with wrong size!
  138. fi
  139. # end of 'acm/V/lib/VClipPoly.c'
  140. fi
  141. if test -f 'acm/V/lib/VGetEyeSpace.c' -a "${1}" != "-c" ; then 
  142.   echo shar: Will not clobber existing file \"'acm/V/lib/VGetEyeSpace.c'\"
  143. else
  144. echo shar: Extracting \"'acm/V/lib/VGetEyeSpace.c'\" \(1794 characters\)
  145. sed "s/^X//" >'acm/V/lib/VGetEyeSpace.c' <<'END_OF_FILE'
  146. X#include "Vlib.h"
  147. X#include <math.h>
  148. X
  149. Xvoid VGetEyeSpace (v, EyePt, CntrInt, up)
  150. XViewport *v;
  151. XVPoint    EyePt, CntrInt, up; {
  152. X
  153. X    VMatrix    Mtx, es;
  154. X    VPoint    C1, C2;
  155. X    double    Hypotenuse, h1, CosA, SinA;
  156. X
  157. X/*
  158. X *  Calculate the eye space transformation matrix
  159. X *
  160. X *  First, orient the Z axis towards the center of interest.
  161. X */
  162. X
  163. X    VIdentMatrix (&(v->eyeSpace));
  164. X    v->eyeSpace.m[0][3] = -EyePt.x;
  165. X    v->eyeSpace.m[1][3] = -EyePt.y;
  166. X    v->eyeSpace.m[2][3] = -EyePt.z;
  167. X    VTransform(&CntrInt, &(v->eyeSpace), &C1);
  168. X
  169. X    VIdentMatrix (&Mtx);
  170. X    Hypotenuse = sqrt(C1.x * C1.x + C1.y * C1.y);
  171. X    if (Hypotenuse > 0.0) {
  172. X        CosA = C1.y / Hypotenuse;
  173. X        SinA = C1.x / Hypotenuse;
  174. X        Mtx.m[0][0] = CosA;
  175. X        Mtx.m[1][0] = SinA;
  176. X        Mtx.m[0][1] = -SinA;
  177. X        Mtx.m[1][1] = CosA;
  178. X        es = v->eyeSpace;
  179. X        VMatrixMult(&es, &Mtx, &(v->eyeSpace));
  180. X    }
  181. X
  182. X    VTransform(&CntrInt, &(v->eyeSpace), &C2);
  183. X    VIdentMatrix (&Mtx);
  184. X    Hypotenuse = sqrt(C2.y * C2.y + C2.z * C2.z);
  185. X    if (Hypotenuse > 0.0) {
  186. X        CosA = C2.y / Hypotenuse;
  187. X        SinA = -C2.z / Hypotenuse;
  188. X        Mtx.m[1][1] = CosA;
  189. X        Mtx.m[2][1] = SinA;
  190. X        Mtx.m[1][2] = -SinA;
  191. X        Mtx.m[2][2] = CosA;
  192. X        es = v->eyeSpace;
  193. X        VMatrixMult(&es, &Mtx, &(v->eyeSpace));
  194. X    }
  195. X
  196. X/*
  197. X *  Orient the y axis towards "up". Swap y and z axes.
  198. X */
  199. X
  200. X    VTransform (&up, &(v->eyeSpace), &C2);
  201. X    VIdentMatrix (&Mtx);
  202. X    h1 = sqrt (C2.y * C2.y + C2.z * C2.z);
  203. X    Hypotenuse = sqrt(C2.x * C2.x + h1 * h1);
  204. X    if (Hypotenuse > 0.0) {
  205. X        CosA = h1 / Hypotenuse;
  206. X        SinA = C2.x / Hypotenuse;
  207. X        if (C2.z < 0.0) {
  208. X            CosA = -CosA;
  209. X        }
  210. X        Mtx.m[0][0] = CosA;
  211. X        Mtx.m[2][0] = SinA;
  212. X        Mtx.m[0][2] = -SinA;
  213. X        Mtx.m[2][2] = CosA;
  214. X        es = v->eyeSpace;
  215. X        VMatrixMult(&es, &Mtx, &(v->eyeSpace));
  216. X    }
  217. X
  218. X    VIdentMatrix (&Mtx);
  219. X    Mtx.m[1][1] = 0.0;
  220. X    Mtx.m[2][1] = 1.0;
  221. X    Mtx.m[1][2] = 1.0;
  222. X    Mtx.m[2][2] = 0.0;
  223. X    es = v->eyeSpace;
  224. X    VMatrixMult(&es, &Mtx, &(v->eyeSpace));
  225. X
  226. X}
  227. END_OF_FILE
  228. if test 1794 -ne `wc -c <'acm/V/lib/VGetEyeSpace.c'`; then
  229.     echo shar: \"'acm/V/lib/VGetEyeSpace.c'\" unpacked with wrong size!
  230. fi
  231. # end of 'acm/V/lib/VGetEyeSpace.c'
  232. fi
  233. if test -f 'acm/V/lib/VOpenVp.c' -a "${1}" != "-c" ; then 
  234.   echo shar: Will not clobber existing file \"'acm/V/lib/VOpenVp.c'\"
  235. else
  236. echo shar: Extracting \"'acm/V/lib/VOpenVp.c'\" \(2391 characters\)
  237. sed "s/^X//" >'acm/V/lib/VOpenVp.c' <<'END_OF_FILE'
  238. X#include "Vlib.h"
  239. X
  240. XViewport *VOpenViewport (dpy, screen, win, unit, dist, scale, width, height)
  241. XDisplay    *dpy;
  242. Xint    screen;
  243. XWindow    win;
  244. Xdouble  unit;
  245. Xdouble  dist;
  246. Xdouble  scale;
  247. Xint    width;
  248. Xint    height; {
  249. X
  250. X    Viewport *v;
  251. X    VPoint     clip[4];
  252. X    int     planes;
  253. X
  254. X/*
  255. X *  Allocate space for the Viewport structure
  256. X */
  257. X
  258. X    v = (Viewport *) Vmalloc (sizeof(Viewport));
  259. X
  260. X/*
  261. X * Calculate screen resolution in pixels per unit.
  262. X */
  263. X
  264. X    v->dist = dist;
  265. X    v->units = unit;
  266. X
  267. X        v->xres = ((((double) DisplayWidth(dpy,screen)) * unit * 1000.0) /
  268. X            ((double) DisplayWidthMM(dpy,screen)));
  269. X        v->yres = ((((double) DisplayHeight(dpy,screen)) * unit * 1000.0) /
  270. X            ((double) DisplayHeightMM(dpy,screen)));
  271. X/*
  272. X *  Use that info to set scaling factors.
  273. X */
  274. X
  275. X        v->Scale.x = v->xres * dist * scale;
  276. X        v->Scale.y = v->yres * dist * scale;
  277. X        v->Scale.z = 1.0;
  278. X
  279. X        v->Middl.x = (double) width / 2.0;
  280. X        v->Middl.y = (double) height / 2.0;
  281. X        v->Middl.z = 0.0;
  282. X
  283. X/*
  284. X *  Build the clipping planes for our view into the eye space.
  285. X */
  286. X
  287. X        clip[0].x = - width / v->xres / 2.0 / scale;
  288. X        clip[0].y = - height / v->yres / 2.0 / scale;
  289. X        clip[0].z = dist;
  290. X        clip[1].x = - width / v->xres / 2.0 / scale;
  291. X        clip[1].y = height / v->yres / 2.0 / scale;
  292. X        clip[1].z = dist;
  293. X        clip[2].x = width / v->xres / 2.0 / scale;
  294. X        clip[2].y = height / v->yres / 2.0 / scale;
  295. X        clip[2].z = dist;
  296. X        clip[3].x = width / v->xres / 2.0 / scale;
  297. X        clip[3].y = - height / v->yres / 2.0 / scale;
  298. X        clip[3].z = dist;
  299. X
  300. X        v->clipPoly = VCreatePolygon (4, clip);
  301. X        VGetPlanes (v->clipPoly);
  302. X
  303. X/*
  304. X *  Fill out the rest of the structure.
  305. X */
  306. X
  307. X    v->flags = VPPerspective | VPClip;
  308. X    v->dpy = dpy;
  309. X    v->screen = screen;
  310. X    v->win = win;
  311. X    VIdentMatrix (&v->eyeSpace);
  312. X    v->set = 0;
  313. X    v->width = width;
  314. X    v->height = height;
  315. X
  316. X/*
  317. X *  Is this a monochrome situation?  We also resort to monochrome on
  318. X *  color systems that probably won't have enough color cell space
  319. X *  to support double buffering.  We'll also use pixmaps if the
  320. X *  global variable "usePixmaps" is non-zero.
  321. X */
  322. X
  323. X    planes = DisplayPlanes (dpy, screen);
  324. X    if (planes < PLANES*2+2 || usePixmaps != 0) {
  325. X        v->monoPixmap = XCreatePixmap (dpy, RootWindow(dpy, screen), width, height, planes);
  326. X        v->flags |= VPPixmap;
  327. X        if (planes == 1)
  328. X            v->flags |= VPMono;
  329. X    }
  330. X
  331. X    return v;
  332. X}
  333. END_OF_FILE
  334. if test 2391 -ne `wc -c <'acm/V/lib/VOpenVp.c'`; then
  335.     echo shar: \"'acm/V/lib/VOpenVp.c'\" unpacked with wrong size!
  336. fi
  337. # end of 'acm/V/lib/VOpenVp.c'
  338. fi
  339. if test -f 'acm/V/test/f' -a "${1}" != "-c" ; then 
  340.   echo shar: Will not clobber existing file \"'acm/V/test/f'\"
  341. else
  342. echo shar: Extracting \"'acm/V/test/f'\" \(2026 characters\)
  343. sed "s/^X//" >'acm/V/test/f' <<'END_OF_FILE'
  344. XF-16-fighter
  345. X90 9
  346. X1 -18.165 0 0
  347. X2 -18.165 -1.191 0
  348. X3 -15.187 -2.085 0
  349. X4 -13.698 -2.382 0
  350. X5 -17.272 -2.382 0
  351. X6 -17.272 -3.573 0
  352. X7 -10.923 -3.573 0
  353. X8 -4.169 -3.573 0
  354. X9 -4.169 -4.765 0
  355. X10 5.598 -4.765 0
  356. X11 18.463 -2.144 0
  357. X12 18.939 -1.787 0
  358. X13 22.274 -1.489 0
  359. X14 24.895 -1.191 0
  360. X15 27.992 0 0
  361. X16 -6.551 -3.573 0
  362. X17 -6.551 -15.485 0
  363. X18 0.357 -15.485 0
  364. X19 0.357 -15.187 0
  365. X20 -2.978 -15.008 0
  366. X21 5.598 -4.765 0
  367. X22 -4.169 -4.765 0
  368. X23 -4.169 -3.573 0
  369. X24 -17.272 -3.573 0
  370. X25 -17.272 -8.934 0.893
  371. X26 -15.187 -8.934 0.893
  372. X27 -10.923 -3.573 0
  373. X28 27.992 0 0
  374. X29 24.895 1.191 0
  375. X30 22.274 1.489 0
  376. X31 18.939 1.787 0
  377. X32 18.463 2.144 0
  378. X33 5.598 4.765 0
  379. X34 -4.169 4.765 0
  380. X35 -4.169 3.573 0
  381. X36 -10.923 3.573 0
  382. X37 -17.272 3.573 0
  383. X38 -17.272 2.382 0
  384. X39 -13.698 2.382 0
  385. X40 -15.187 2.085 0
  386. X41 -18.165 1.191 0
  387. X42 -18.165 0 0
  388. X43 5.598 4.765 0
  389. X44 -2.978 15.008 0
  390. X45 0.357 15.187 0
  391. X46 0.357 15.485 0
  392. X47 -6.551 15.485 0
  393. X48 -6.551 3.573 0
  394. X49 -4.169 3.573 0
  395. X50 -4.169 4.765 0
  396. X51 -10.923 3.573 0
  397. X52 -15.187 8.934 0.893
  398. X53 -17.272 8.934 0.893
  399. X54 -17.272 3.573 0
  400. X55 27.992 0 0
  401. X56 23.525 0 -1.191
  402. X57 17.272 0 -2.382
  403. X58 15.783 0 -3.812
  404. X59 13.996 0 -4.169
  405. X60 11.316 0 -4.05
  406. X61 8.338 0 -3.335
  407. X62 1.787 0 -2.382
  408. X63 -4.169 0 -2.382
  409. X64 -13.936 0 -1.906
  410. X65 -15.128 0 -1.906
  411. X66 -15.187 0 -1.787
  412. X67 -18.165 0 -1.191
  413. X68 -18.165 0 0
  414. X69 -4.169 0 -2.382
  415. X70 -10.125 0 -4.05
  416. X71 -15.783 0 -10.482
  417. X72 -19.654 0 -10.482
  418. X73 -19.654 0 -9.529
  419. X74 -19.654 0 -9.529
  420. X75 -16.378 0 -3.573
  421. X76 -16.378 0 -2.144
  422. X77 -14.889 0 -2.382
  423. X78 -13.936 0 -2.382
  424. X79 -13.936 0 -1.906
  425. X80 -18.165 0 0
  426. X81 -18.165 0 1.191
  427. X82 -15.187 0 2.085
  428. X83 -13.698 0 2.263
  429. X84 -2.68 0 2.382
  430. X85 8.04 0 2.382
  431. X86 12.507 0 2.263
  432. X87 12.507 0 0.596
  433. X88 19.952 0 0.596
  434. X89 23.525 0 0.476
  435. X90 27.992 0 0
  436. Xgray 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  437. Xgray 8 16 17 18 19 20 21 22 23
  438. Xgray 4 24 25 26 27
  439. Xgray 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  440. Xgray 8 43 44 45 46 47 48 49 50
  441. Xgray 4 51 52 53 54
  442. Xgray 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
  443. Xgray 11 69 70 71 72 73 74 75 76 77 78 79
  444. Xgray 11 80 81 82 83 84 85 86 87 88 89 90
  445. END_OF_FILE
  446. if test 2026 -ne `wc -c <'acm/V/test/f'`; then
  447.     echo shar: \"'acm/V/test/f'\" unpacked with wrong size!
  448. fi
  449. # end of 'acm/V/test/f'
  450. fi
  451. if test -f 'acm/V/test/f16' -a "${1}" != "-c" ; then 
  452.   echo shar: Will not clobber existing file \"'acm/V/test/f16'\"
  453. else
  454. echo shar: Extracting \"'acm/V/test/f16'\" \(3135 characters\)
  455. sed "s/^X//" >'acm/V/test/f16' <<'END_OF_FILE'
  456. XF-16-fighter
  457. X130 12
  458. X1 -18.165 0 0
  459. X2 -18.165 -1.191 0
  460. X3 -15.187 -2.085 0
  461. X4 -13.698 -2.382 0
  462. X5 -17.272 -2.382 0
  463. X6 -17.272 -3.573 0
  464. X7 -10.923 -3.573 0
  465. X8 -4.169 -3.573 0
  466. X9 -4.169 -4.765 0
  467. X10 5.598 -4.765 0
  468. X11 18.463 -2.144 0
  469. X12 18.939 -1.787 0
  470. X13 22.274 -1.489 0
  471. X14 24.895 -1.191 0
  472. X15 27.992 0 0
  473. X16 -6.551 -3.573 0
  474. X17 -6.551 -15.485 0
  475. X18 0.357 -15.485 0
  476. X19 0.357 -15.187 0
  477. X20 -2.978 -15.008 0
  478. X21 5.598 -4.765 0
  479. X22 -4.169 -4.765 0
  480. X23 -4.169 -3.573 0
  481. X24 -17.272 -3.573 0
  482. X25 -17.272 -8.934 0.893
  483. X26 -15.187 -8.934 0.893
  484. X27 -10.923 -3.573 0
  485. X28 27.992 0 0
  486. X29 24.895 1.191 0
  487. X30 22.274 1.489 0
  488. X31 18.939 1.787 0
  489. X32 18.463 2.144 0
  490. X33 5.598 4.765 0
  491. X34 -4.169 4.765 0
  492. X35 -4.169 3.573 0
  493. X36 -10.923 3.573 0
  494. X37 -17.272 3.573 0
  495. X38 -17.272 2.382 0
  496. X39 -13.698 2.382 0
  497. X40 -15.187 2.085 0
  498. X41 -18.165 1.191 0
  499. X42 -18.165 0 0
  500. X43 5.598 4.765 0
  501. X44 -2.978 15.008 0
  502. X45 0.357 15.187 0
  503. X46 0.357 15.485 0
  504. X47 -6.551 15.485 0
  505. X48 -6.551 3.573 0
  506. X49 -4.169 3.573 0
  507. X50 -4.169 4.765 0
  508. X51 -10.923 3.573 0
  509. X52 -15.187 8.934 0.893
  510. X53 -17.272 8.934 0.893
  511. X54 -17.272 3.573 0
  512. X55 27.992 0 0
  513. X56 23.525 0 -1.191
  514. X57 17.272 0 -2.382
  515. X58 15.783 0 -3.812
  516. X59 13.996 0 -4.169
  517. X60 11.316 0 -4.05
  518. X61 8.338 0 -3.335
  519. X62 1.787 0 -2.382
  520. X63 -4.169 0 -2.382
  521. X64 -13.936 0 -1.906
  522. X65 -15.128 0 -1.906
  523. X66 -15.187 0 -1.787
  524. X67 -18.165 0 -1.191
  525. X68 -18.165 0 0
  526. X69 -4.169 0 -2.382
  527. X70 -10.125 0 -4.05
  528. X71 -15.783 0 -10.482
  529. X72 -19.654 0 -10.482
  530. X73 -19.654 0 -9.529
  531. X74 -19.654 0 -9.529
  532. X75 -16.378 0 -3.573
  533. X76 -16.378 0 -2.144
  534. X77 -14.889 0 -2.382
  535. X78 -13.936 0 -2.382
  536. X79 -13.936 0 -1.906
  537. X80 -18.165 0 0
  538. X81 -18.165 0 1.191
  539. X82 -15.187 0 2.085
  540. X83 -13.698 0 2.263
  541. X84 -2.68 0 2.382
  542. X85 8.04 0 2.382
  543. X86 12.507 0 2.263
  544. X87 12.507 0 0.596
  545. X88 19.952 0 0.596
  546. X89 23.525 0 0.476
  547. X90 27.992 0 0
  548. X91 -3.551 0 -2.382
  549. X92 -3.551 -3.871 -0.10
  550. X93 -3.551 -15.485 0
  551. X94 -3.551 -15.485 0.1065
  552. X95 -3.551 -3.871 0.142
  553. X96 -3.551 -2.58 0.2556
  554. X97 -3.551 -2.387 1.818
  555. X98 -3.551 -2.102 2.015
  556. X99 -3.551 -1.03 2.251
  557. X100 -3.551 0 2.282
  558. X101 -3.551 1.03 2.251
  559. X102 -3.551 2.102 2.015
  560. X103 -3.551 2.387 1.818
  561. X104 -3.551 2.58 0.2556
  562. X105 -3.551 3.871 0.142
  563. X106 -3.551 15.485 0.1065
  564. X107 -3.551 15.485 0
  565. X108 -3.551 3.871 -0.10
  566. X109 13.996 0 -4.169
  567. X110 13.996 -0.8932 -3.692
  568. X111 13.996 -1.191 -2.978
  569. X112 13.996 -1.251 -2.502
  570. X113 13.996 -1.787 -1.311
  571. X114 13.996 -3.054 0
  572. X115 13.996 -1.583 0.3568
  573. X116 13.996 0 0.596
  574. X117 13.996 1.583 0.3568
  575. X118 13.996 3.054 0
  576. X119 13.996 1.787 -1.311
  577. X120 13.996 1.251 -2.502
  578. X121 13.996 1.191 -2.978
  579. X122 13.996 0.8932 -3.692
  580. X123 -18.165 1.191 0
  581. X124 -18.165 0.842 0.842
  582. X125 -18.165 0 1.191
  583. X126 -18.165 -0.842 0.842
  584. X127 -18.165 -1.191 0
  585. X128 -18.165 -0.842 -0.842
  586. X129 -18.165 0 -1.191
  587. X130 -18.165 0.842 -0.842
  588. Xgray33 14 109 110 111 112 113 114 115 116 117 118 119 120 121 122
  589. Xgray33 18 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
  590. Xgray33 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  591. Xgray33 8 16 17 18 19 20 21 22 23
  592. Xgray33 4 24 25 26 27
  593. Xgray33 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  594. Xgray33 8 43 44 45 46 47 48 49 50
  595. Xgray33 4 51 52 53 54
  596. Xgray33 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
  597. Xgray33 11 69 70 71 72 73 74 75 76 77 78 79
  598. Xgray33 11 80 81 82 83 84 85 86 87 88 89 90
  599. Xgray33 8 123 124 125 126 127 128 129 130
  600. END_OF_FILE
  601. if test 3135 -ne `wc -c <'acm/V/test/f16'`; then
  602.     echo shar: \"'acm/V/test/f16'\" unpacked with wrong size!
  603. fi
  604. # end of 'acm/V/test/f16'
  605. fi
  606. if test -f 'acm/V/test/mig23' -a "${1}" != "-c" ; then 
  607.   echo shar: Will not clobber existing file \"'acm/V/test/mig23'\"
  608. else
  609. echo shar: Extracting \"'acm/V/test/mig23'\" \(2494 characters\)
  610. sed "s/^X//" >'acm/V/test/mig23' <<'END_OF_FILE'
  611. Xmig-23-wings-swept
  612. X88 10
  613. X1 36.5891 0 0
  614. X2 34.4368 0.86092 0
  615. X3 30.9931 1.29138 0
  616. X4 27.119 1.72184 0
  617. X5 20.6621 1.72184 0
  618. X6 18.9402 2.1523 0
  619. X7 14.2052 3.01322 0
  620. X8 -3.44368 2.58276 0
  621. X9 -9.03966 2.1523 0
  622. X10 -16.7879 0.86092 0
  623. X11 -18.0793 0.43046 0
  624. X12 -18.0793 0 0
  625. X13 36.5891 0 0
  626. X14 34.4368 -0.86092 0
  627. X15 30.9931 -1.29138 0
  628. X16 27.119 -1.72184 0
  629. X17 20.6621 -1.72184 0
  630. X18 18.9402 -2.1523 0
  631. X19 14.2052 -3.01322 0
  632. X20 -3.44368 -2.58276 0
  633. X21 -9.03966 -2.1523 0
  634. X22 -16.7879 -0.86092 0
  635. X23 -18.0793 -0.43046 0
  636. X24 -18.0793 0 0
  637. X25 14.2052 3.01322 -3.01322
  638. X26 4.73506 7.31782 -3.01322
  639. X27 6.02644 8.6092 -3.01322
  640. X28 -11.192 13.7747 -3.01322
  641. X29 -12.0529 13.7747 -3.01322
  642. X30 -14.2052 11.192 -3.01322
  643. X31 -14.2052 10.7615 -3.01322
  644. X32 -3.44368 2.58276 -3.01322
  645. X33 14.2052 -3.01322 -3.01322
  646. X34 4.73506 -7.31782 -3.01322
  647. X35 6.02644 -8.6092 -3.01322
  648. X36 -11.192 -13.7747 -3.01322
  649. X37 -12.0529 -13.7747 -3.01322
  650. X38 -14.2052 -11.192 -3.01322
  651. X39 -14.2052 -10.7615 -3.01322
  652. X40 -3.44368 -2.58276 -3.01322
  653. X41 -18.9402 3.01322 -1.72184
  654. X42 -20.2316 7.31782 -1.72184
  655. X43 -18.5098 8.6092 -1.72184
  656. X44 -9.03966 2.1523 -1.72184
  657. X45 -16.7879 0.86092 -1.72184
  658. X46 -18.9402 -3.01322 -1.72184
  659. X47 -20.2316 -7.31782 -1.72184
  660. X48 -18.5098 -8.6092 -1.72184
  661. X49 -9.03966 -2.1523 -1.72184
  662. X50 -16.7879 -0.86092 -1.72184
  663. X51 36.5891 0 0
  664. X52 33.1454 0 -1.29138
  665. X53 30.1322 0 -2.1523
  666. X54 25.8276 0 -2.58276
  667. X55 22.3839 0 -3.87414
  668. X56 18.0793 0 -4.3046
  669. X57 9.47012 0 -3.87414
  670. X58 -0.860918 0 -3.44368
  671. X59 -8.6092 0 -6.02644
  672. X60 -16.3575 0 -10.331
  673. X61 -18.9402 0 -9.03966
  674. X62 -18.0793 0 -3.87414
  675. X63 -19.8012 0 -3.44368
  676. X64 -17.2184 0 -1.72184
  677. X65 -18.0793 0 -1.72184
  678. X66 -18.0793 0 1.29138
  679. X67 -15.4966 0 1.72184
  680. X68 -6.4569 0 2.1523
  681. X69 10.331 0 2.1523
  682. X70 20.2316 0 1.72184
  683. X71 28.8408 0 1.29138
  684. X72 33.1454 0 0.86092
  685. X73 -15.4966 0 1.72184
  686. X74 -15.4966 0 4.3046
  687. X75 -13.3443 0 5.16552
  688. X76 -6.4569 0 2.1523
  689. X77 20.6621 1.72184 -3.01322
  690. X78 18.9402 2.1523 -3.01322
  691. X79 14.2052 3.01322 -3.01322
  692. X80 -3.44368 2.58276 -3.01322
  693. X81 -3.44368 -2.58276 -3.01322
  694. X82 14.2052 -3.01322 -3.01322
  695. X83 18.9402 -2.1523 -3.01322
  696. X84 20.6621 -1.72184 -3.01322
  697. X85 -3.44368 2.58276 -3.01322
  698. X86 -16.7879 0.86092 -1.72184
  699. X87 -16.7879 -0.86092 -1.72184
  700. X88 -3.44368 -2.58276 -3.01322
  701. Xgray 12 1 2 3 4 5 6 7 8 9 10 11 12
  702. Xgray 12 13 14 15 16 17 18 19 20 21 22 23 24
  703. Xgray 8 25 26 27 28 29 30 31 32
  704. Xgray 8 33 34 35 36 37 38 39 40
  705. Xgray 5 41 42 43 44 45
  706. Xgray 5 46 47 48 49 50
  707. Xgray 22 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  708. Xgray 4 73 74 75 76
  709. Xgray 8 77 78 79 80 81 82 83 84
  710. Xgray 4 85 86 87 88
  711. END_OF_FILE
  712. if test 2494 -ne `wc -c <'acm/V/test/mig23'`; then
  713.     echo shar: \"'acm/V/test/mig23'\" unpacked with wrong size!
  714. fi
  715. # end of 'acm/V/test/mig23'
  716. fi
  717. if test -f 'acm/fsim/Imakefile' -a "${1}" != "-c" ; then 
  718.   echo shar: Will not clobber existing file \"'acm/fsim/Imakefile'\"
  719. else
  720. echo shar: Extracting \"'acm/fsim/Imakefile'\" \(2147 characters\)
  721. sed "s/^X//" >'acm/fsim/Imakefile' <<'END_OF_FILE'
  722. X/*
  723. X * mips RISC/os should add "-systype bsd43" to CDEBUGFLAGS.
  724. X *
  725. X * dec 5000 series systems should add -Ddec to CDEBUGFLAGS.  Once
  726. X * again, I don't know the symbol, so I can't do it right here.
  727. X *
  728. X * System V systems needs -DSYSV, but I think that's done
  729. X * automatically by the Imake configuration files for System V-like
  730. X * systems, so you probably shouldn't have to worry about it.
  731. X */
  732. X
  733. X#include "../acm.def"
  734. X
  735. X/*
  736. X *  For Mips RISC/OS:
  737. X *  My IMAKEINCLUDE environment variable is set to "-I. -Dmips -SYSTYPE_BSD"
  738. X */
  739. X#ifdef MipsArchitecture
  740. XCDEBUGFLAGS = -systype bsd43 $(STD_INCLUDES) -O
  741. XXLIB = -lX11
  742. X#endif
  743. X
  744. X#if HasVoidSignalReturn == YES
  745. XDEFINES=    -DSIGVOID
  746. X#endif
  747. X
  748. XSRCS1=         server.c pm.c flaps.c droneCalc.c init.c aim9m.c\
  749. X        m61a1.c weapon.c newPlayer.c newPlane.c missile.c\
  750. X        missileCalc.c update.c doEvents.c getStick.c\
  751. X        damage.c panel.c doViews.c\
  752. X        doRadar.c placeCraft.c transpose.c doScale.c
  753. XOBJS1=        server.o pm.o flaps.o droneCalc.o init.o aim9m.o\
  754. X        m61a1.o weapon.o newPlayer.o newPlane.o missile.o\
  755. X        missileCalc.o update.o doEvents.o getStick.o\
  756. X        damage.o panel.o doViews.o\
  757. X        doRadar.o placeCraft.o transpose.o doScale.o
  758. XDEPLIBS1=    ../V/lib/libV.a
  759. X
  760. XSRCS2=        acm.c
  761. XOBJS2=        acm.o
  762. XDEPLIBS2=
  763. X
  764. XSRCS3=        V2tgif.c
  765. XOBJS3=        V2tgif.o
  766. XDEPLIBS3=    ../V/lib/libV.a
  767. X
  768. XPROGRAMS=        acm acms v2tgif
  769. XSTD_INCLUDES=        -I../V/lib
  770. X#ifdef notdef
  771. XLOCAL_LIBRARIES=    -L../V/lib -lV -lm $(XLIB)
  772. X#endif
  773. XLOCAL_LIBRARIES=    ../V/lib/libV.a
  774. XSYS_LIBRARIES=        -lm $(XLIB)
  775. X
  776. XOBJS= $(OBJS1) $(OBJS2) $(OBJS3)
  777. XSRCS= $(SRCS1) $(SRCS2) $(SRCS3)
  778. X
  779. XAllTarget($(PROGRAMS))
  780. X
  781. XNormalProgramTarget(acms,$(OBJS1),$(DEPLIBS1),$(LOCAL_LIBRARIES),)
  782. XSaberProgramTarget(acms,$(SRCS1),$(OBJS1),$(LOCAL_LIBRARIES),)
  783. X
  784. XInstallProgram(acms,$(BINDIR))
  785. X
  786. XNormalProgramTarget(acm,$(OBJS2),$(DEPLIBS2),$(LOCAL_LIBRARIES),)
  787. XSaberProgramTarget(acm,$(SRCS2),$(OBJS2),$(LOCAL_LIBRARIES),)
  788. X
  789. XInstallProgram(acm,$(BINDIR))
  790. XInstallManPage(acm,$(MANDIR))
  791. X
  792. XNormalProgramTarget(v2tgif,$(OBJS3),$(DEPLIBS3),$(LOCAL_LIBRARIES),)
  793. XSaberProgramTarget(v2tgif,$(SRCS3),$(OBJS3),$(LOCAL_LIBRARIES),)
  794. X
  795. XDependTarget()
  796. XLintTarget()
  797. X
  798. Xinstall:: install.man
  799. X
  800. Xtar:
  801. X    tar cv acm acms f16 mig23 aim-9 rwy rwy2 tower mtn bullet
  802. END_OF_FILE
  803. if test 2147 -ne `wc -c <'acm/fsim/Imakefile'`; then
  804.     echo shar: \"'acm/fsim/Imakefile'\" unpacked with wrong size!
  805. fi
  806. # end of 'acm/fsim/Imakefile'
  807. fi
  808. if test -f 'acm/fsim/acm.c' -a "${1}" != "-c" ; then 
  809.   echo shar: Will not clobber existing file \"'acm/fsim/acm.c'\"
  810. else
  811. echo shar: Extracting \"'acm/fsim/acm.c'\" \(2789 characters\)
  812. sed "s/^X//" >'acm/fsim/acm.c' <<'END_OF_FILE'
  813. X/*
  814. X *    xflight : an aerial combat simulator for X
  815. X *
  816. X *    Written by Riley Rainey,  riley@mips.com
  817. X *
  818. X *    Permission to use, copy, modify and distribute (without charge) this
  819. X *    software, documentation, images, etc. is granted, provided that this 
  820. X *    comment and the author's name is retained.
  821. X *
  822. X */
  823. X#include "manifest.h"
  824. X#include <sys/types.h>
  825. X#include <stdio.h>
  826. X#include <pwd.h>
  827. X#include <signal.h>
  828. X#include <sys/socket.h>
  829. X#include <netinet/in.h>
  830. X#include <netdb.h>
  831. X#include <setjmp.h>
  832. X
  833. Xextern char *getenv ();
  834. Xextern struct servent *getservent();
  835. X
  836. Xjmp_buf    dead;
  837. X
  838. Xdone () {
  839. X    longjmp (dead);
  840. X}
  841. X
  842. Xmain (argc, argv)
  843. Xint    argc;
  844. Xchar    *argv[]; {
  845. X
  846. X    char    *display;
  847. X    char    *host;
  848. X    char    myhost[64];
  849. X    char    args[128];
  850. X    int    s, n = 1;
  851. X    struct passwd    *pwent, *getpwuid();
  852. X    struct sockaddr_in sin;
  853. X    struct hostent    *h = (struct hostent *) NULL;
  854. X
  855. X    if ((host = getenv("ACMSERVER")) == NULL)
  856. X        if (argc >= 2) {
  857. X            host = argv[1];
  858. X            n = 2;
  859. X        }
  860. X        else {
  861. X            fprintf (stderr, "usage: %s server-hostname\n", argv[0]);
  862. X            exit (1);
  863. X        }
  864. X
  865. X    if ((pwent = getpwuid(getuid())) == NULL) {
  866. X        fprintf (stderr, "Yow!\n");
  867. X        exit (1);
  868. X    }
  869. X
  870. X    if ((display = getenv("DISPLAY")) == NULL) {
  871. X        fprintf (stderr, "Excuse me, but you have no DISPLAY.\n\
  872. XHow do you use X, anyway?\n");
  873. X        exit (1);
  874. X    }
  875. X
  876. X/*
  877. X *  Sometimes we end up with a DISPLAY value that won't jive on the
  878. X *  network (e.g. ":0.0") -- fix these cases.
  879. X */
  880. X
  881. X    if (*display == ':') {
  882. X        gethostname (myhost, sizeof(myhost));
  883. X        strcat (myhost, display);
  884. X        display = myhost;
  885. X    }
  886. X    else if (strcmp (display, "unix:0.0") == 0 ||
  887. X        strcmp (display, "unix:0") == 0) {
  888. X        gethostname (myhost, sizeof(myhost));
  889. X        strcat (myhost, ":0.0");
  890. X        display = myhost;
  891. X    }
  892. X
  893. X    if ((sin.sin_addr.s_addr = inet_addr (host)) != -1) {
  894. X        sin.sin_family = AF_INET;
  895. X    }
  896. X    else if ((h = gethostbyname (host)) != 0) {
  897. X        sin.sin_family = h->h_addrtype;
  898. X        bcopy (h->h_addr, &sin.sin_addr, h->h_length);
  899. X    }
  900. X    else {
  901. X        fprintf (stderr, "Unknown host \"%s\"\n", host);
  902. X        exit (1);
  903. X    }
  904. X
  905. X    sin.sin_port = htons(ACM_PORT);
  906. X
  907. X    signal (SIGPIPE, done);
  908. X
  909. X    if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
  910. X        perror ("can't get a socket");
  911. X        exit (1);
  912. X    }
  913. X
  914. X    if (connect (s, (struct sockaddr *) &sin, sizeof (sin)) < 0) {
  915. X        perror ("can't connect to server");
  916. X        close (s);
  917. X        exit (1);
  918. X    }
  919. X
  920. X    if (argv[n] != (char *) NULL) 
  921. X        strcpy (args, argv[n++]);
  922. X    else
  923. X        strcpy (args, "");
  924. X
  925. X    for (; argv[n] != (char *) NULL; ++n) {
  926. X        strcat (args, "|");
  927. X        strcat (args, argv[n]);
  928. X    }
  929. X
  930. X    if (setjmp (dead) == 0)
  931. X        handshake (s, display, pwent->pw_name, args);
  932. X
  933. X    exit (0);
  934. X}
  935. X
  936. Xhandshake (s, dpy, name, args)
  937. Xint    s;
  938. Xchar    *dpy, *name, *args; {
  939. X
  940. X    char    info[128];
  941. X    int    n;
  942. X
  943. X    sprintf (info, "%s %s %s\n", dpy, name, args);
  944. X    write (s, info, strlen (info));
  945. X    while ((n = read (s, info, sizeof (info))) > 0)
  946. X        write (fileno (stdout), info, n);
  947. X
  948. X    return 0;
  949. X}
  950. END_OF_FILE
  951. if test 2789 -ne `wc -c <'acm/fsim/acm.c'`; then
  952.     echo shar: \"'acm/fsim/acm.c'\" unpacked with wrong size!
  953. fi
  954. # end of 'acm/fsim/acm.c'
  955. fi
  956. if test -f 'acm/fsim/damage.c' -a "${1}" != "-c" ; then 
  957.   echo shar: Will not clobber existing file \"'acm/fsim/damage.c'\"
  958. else
  959. echo shar: Extracting \"'acm/fsim/damage.c'\" \(2826 characters\)
  960. sed "s/^X//" >'acm/fsim/damage.c' <<'END_OF_FILE'
  961. X/*
  962. X *    xflight : an aerial combat simulator for X
  963. X *
  964. X *    Written by Riley Rainey,  riley@mips.com
  965. X *
  966. X *    Permission to use, copy, modify and distribute (without charge) this
  967. X *    software, documentation, images, etc. is granted, provided that this 
  968. X *    comment and the author's name is retained.
  969. X *
  970. X */
  971. X
  972. X#include "pm.h"
  973. X#include "damage.h"
  974. X
  975. Xextern long random();
  976. X
  977. Xdouble    frandom () {
  978. X
  979. X    return (double) (random() & 0xffff) / 65536.0;
  980. X}
  981. X
  982. X/*
  983. X *  Select a subsystem to receive damage.
  984. X */
  985. X
  986. Xlong    selectSystem () {
  987. X
  988. X    double    r;
  989. X    long    i;
  990. X
  991. X    if ((r = frandom()) < 0.25)
  992. X        i = SYS_ENGINE1;
  993. X    else if (r < 0.35)
  994. X        i = SYS_RADAR;
  995. X    else if (r < 0.40)
  996. X        i = SYS_TEWS;
  997. X    else if (r < 0.45)
  998. X        i = SYS_HYD1;
  999. X    else if (r < 0.50)
  1000. X        i = SYS_HYD2;
  1001. X    else if (r < 0.55)
  1002. X        i = SYS_GEN1;
  1003. X    else if (r < 0.60)
  1004. X        i = SYS_GEN2;
  1005. X    else if (r < 0.65)
  1006. X        i = SYS_FLAPS;
  1007. X    else if (r < 0.70)
  1008. X        i = SYS_SPEEDBRAKE;
  1009. X    else if (r < 0.80)
  1010. X        i = SYS_FUEL;
  1011. X    else if (r < 0.95)
  1012. X        i = SYS_HUD;
  1013. X    return i;
  1014. X}
  1015. X
  1016. Xvoid    damageSystem (c, sys)
  1017. Xcraft    *c;
  1018. Xlong    sys; {
  1019. X
  1020. X    if ((c->damageBits & sys) || (sys == SYS_FUEL)) {
  1021. X
  1022. X        c->damageBits &= ~ sys;
  1023. X
  1024. X        switch (sys) {
  1025. X
  1026. X        case SYS_ENGINE1:
  1027. X            c->throttle = 0;
  1028. X            break;
  1029. X
  1030. X        case SYS_RADAR:
  1031. X            c->curRadarTarget = -1;
  1032. X            break;
  1033. X
  1034. X/*
  1035. X *  Fuel leaks can be up to 40 pounds per second here.
  1036. X */
  1037. X
  1038. X        case SYS_FUEL:
  1039. X            c->leakRate += (frandom() + frandom()) * 20.0;
  1040. X            break;
  1041. X        
  1042. X        case SYS_HYD1:
  1043. X        case SYS_HYD2:
  1044. X            if ((c->damageBits & (SYS_HYD1 | SYS_HYD2)) == 0) {
  1045. X                c->damageBits &= ~ SYS_SPEEDBRAKE;
  1046. X                c->damageBits &= ~ SYS_FLAPS;
  1047. X            }
  1048. X            break;
  1049. X
  1050. X        case SYS_GEN1:
  1051. X        case SYS_GEN2:
  1052. X            if ((c->damageBits & (SYS_GEN1 | SYS_GEN2)) == 0) {
  1053. X                c->damageBits &= ~
  1054. X                    (SYS_HUD | SYS_RADAR | SYS_TEWS);
  1055. X                break;
  1056. X            }
  1057. X        }
  1058. X
  1059. X    }
  1060. X}
  1061. X
  1062. X/*
  1063. X * absorbDamage :  craft c is hit with d points of damage.
  1064. X */
  1065. X
  1066. Xint    absorbDamage (c, d)
  1067. Xcraft    *c;
  1068. Xint    d; {
  1069. X
  1070. X    double    n;
  1071. X    register long    sys;
  1072. X
  1073. X    for (; d > 0; --d) {
  1074. X
  1075. X/*
  1076. X *  For each damage point absorbed, there is a 30 percent chance that
  1077. X *  it will be absorbed by some subsystem other than the actual
  1078. X *  airframe.
  1079. X */
  1080. X
  1081. X        if (frandom() <= 0.30) {
  1082. X            sys = selectSystem();
  1083. X            damageSystem (c, sys);
  1084. X        }
  1085. X
  1086. X/*
  1087. X *  For each point absorbed by the airframe, there is a 20% chance that
  1088. X *  it'll be absorbed by the wing and induce a rolling moment or a 10 
  1089. X *  percent chance that it will hit a horizontal stabilizer and induce
  1090. X *  a pitching and rolling moment.
  1091. X */
  1092. X
  1093. X        else {
  1094. X
  1095. X        if ((n = frandom()) <= 0.20) {
  1096. X            c->damageCL += (frandom() - 0.5) * 0.20;
  1097. X        }
  1098. X        else if (n <= 0.30) {
  1099. X            c->damageCL += (frandom() - 0.5) * 0.10;
  1100. X            c->damageCM += (frandom() - 0.5) * 0.20;
  1101. X        }
  1102. X
  1103. X        if (--(c->structurePts) <= 0)
  1104. X            return 0;
  1105. X        }
  1106. X
  1107. X    }
  1108. X
  1109. X    return 1;
  1110. X
  1111. X}
  1112. X
  1113. Xvoid    initDamage (c)
  1114. Xcraft    *c; {
  1115. X
  1116. X    c->damageBits = c->cinfo->damageBits;
  1117. X    c->structurePts = c->cinfo->structurePts;
  1118. X    c->leakRate = 0.0;
  1119. X    c->damageCL = 0.0;
  1120. X    c->damageCM = 0.0;
  1121. X}
  1122. END_OF_FILE
  1123. if test 2826 -ne `wc -c <'acm/fsim/damage.c'`; then
  1124.     echo shar: \"'acm/fsim/damage.c'\" unpacked with wrong size!
  1125. fi
  1126. # end of 'acm/fsim/damage.c'
  1127. fi
  1128. if test -f 'acm/fsim/eng.xbm' -a "${1}" != "-c" ; then 
  1129.   echo shar: Will not clobber existing file \"'acm/fsim/eng.xbm'\"
  1130. else
  1131. echo shar: Extracting \"'acm/fsim/eng.xbm'\" \(3314 characters\)
  1132. sed "s/^X//" >'acm/fsim/eng.xbm' <<'END_OF_FILE'
  1133. X#define eng_width 64
  1134. X#define eng_height 64
  1135. X#define eng_x_hot 31
  1136. X#define eng_y_hot 31
  1137. Xstatic char eng_bits[] = {
  1138. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
  1139. X   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00,
  1140. X   0x00, 0x00, 0xf8, 0x03, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x36, 0xc0,
  1141. X   0x01, 0x36, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x01, 0x58, 0x00, 0x00,
  1142. X   0x00, 0xc0, 0x03, 0x80, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x80,
  1143. X   0x00, 0x80, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00,
  1144. X   0x00, 0x14, 0x00, 0xc0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0a, 0x00, 0x20,
  1145. X   0x01, 0x00, 0x28, 0x00, 0x00, 0x05, 0x00, 0x20, 0x01, 0x00, 0x52, 0x00,
  1146. X   0x00, 0x03, 0x00, 0x20, 0x01, 0x00, 0x66, 0x00, 0x80, 0x01, 0x00, 0x20,
  1147. X   0x01, 0x00, 0xce, 0x00, 0xc0, 0x00, 0x00, 0x20, 0x01, 0x00, 0x83, 0x01,
  1148. X   0xc0, 0x00, 0x00, 0x20, 0x01, 0x00, 0x80, 0x01, 0x60, 0x00, 0x00, 0xc0,
  1149. X   0x00, 0x00, 0x00, 0x03, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
  1150. X   0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x28, 0x00, 0x00, 0x00,
  1151. X   0x00, 0x00, 0x00, 0x0a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
  1152. X   0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00,
  1153. X   0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
  1154. X   0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00,
  1155. X   0x00, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
  1156. X   0x06, 0x62, 0x0c, 0x00, 0x00, 0x80, 0x31, 0x30, 0x06, 0x93, 0x12, 0x00,
  1157. X   0x00, 0x40, 0x48, 0x30, 0x06, 0x92, 0x12, 0x00, 0x00, 0x40, 0x48, 0x30,
  1158. X   0x76, 0x92, 0x12, 0x00, 0x00, 0xc0, 0x49, 0x37, 0x56, 0x92, 0x12, 0x80,
  1159. X   0x00, 0x40, 0x4a, 0x35, 0x76, 0x92, 0x12, 0x00, 0x00, 0x40, 0x4a, 0x37,
  1160. X   0x06, 0x92, 0x12, 0x00, 0x00, 0x40, 0x4a, 0x30, 0x06, 0x67, 0x0c, 0x00,
  1161. X   0x00, 0x80, 0x31, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
  1162. X   0x06, 0x00, 0xc0, 0x39, 0x91, 0x05, 0x00, 0x30, 0x0c, 0x00, 0x40, 0x4a,
  1163. X   0x91, 0x04, 0x00, 0x18, 0x0c, 0x00, 0x40, 0x4a, 0x1b, 0x02, 0x00, 0x18,
  1164. X   0x0c, 0x00, 0x40, 0x4a, 0x15, 0x02, 0x00, 0x18, 0x0c, 0x00, 0xc0, 0x39,
  1165. X   0x15, 0x01, 0x00, 0x18, 0x18, 0x00, 0x40, 0x09, 0x91, 0x00, 0x00, 0x0c,
  1166. X   0x18, 0x00, 0x40, 0x0a, 0x91, 0x06, 0x00, 0x0c, 0x28, 0x00, 0x40, 0x0a,
  1167. X   0x11, 0x06, 0x00, 0x0a, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
  1168. X   0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x60, 0x00, 0x00, 0x00,
  1169. X   0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x30, 0x06, 0x00, 0x80, 0x01,
  1170. X   0xc0, 0x40, 0x00, 0x48, 0x09, 0x00, 0x81, 0x01, 0x80, 0x79, 0x00, 0x48,
  1171. X   0x09, 0x00, 0xcf, 0x00, 0x00, 0x33, 0x00, 0x30, 0x09, 0x00, 0x66, 0x00,
  1172. X   0x00, 0x25, 0x00, 0x48, 0x09, 0x00, 0x52, 0x00, 0x00, 0x0a, 0x00, 0x48,
  1173. X   0x09, 0x00, 0x28, 0x00, 0x00, 0x14, 0x00, 0x48, 0x09, 0x00, 0x14, 0x00,
  1174. X   0x00, 0x38, 0x00, 0x30, 0x06, 0x00, 0x0e, 0x00, 0x00, 0xe0, 0x00, 0x80,
  1175. X   0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x80, 0x00, 0xe0, 0x01, 0x00,
  1176. X   0x00, 0x00, 0x0d, 0x40, 0x01, 0x58, 0x00, 0x00, 0x00, 0x00, 0x36, 0xc0,
  1177. X   0x01, 0x36, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe0, 0x0f, 0x00, 0x00,
  1178. X   0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
  1179. X   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1180. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  1181. END_OF_FILE
  1182. if test 3314 -ne `wc -c <'acm/fsim/eng.xbm'`; then
  1183.     echo shar: \"'acm/fsim/eng.xbm'\" unpacked with wrong size!
  1184. fi
  1185. # end of 'acm/fsim/eng.xbm'
  1186. fi
  1187. if test -f 'acm/fsim/exp.xbm' -a "${1}" != "-c" ; then 
  1188.   echo shar: Will not clobber existing file \"'acm/fsim/exp.xbm'\"
  1189. else
  1190. echo shar: Extracting \"'acm/fsim/exp.xbm'\" \(3272 characters\)
  1191. sed "s/^X//" >'acm/fsim/exp.xbm' <<'END_OF_FILE'
  1192. X#define exp_width 64
  1193. X#define exp_height 64
  1194. Xstatic char exp_bits[] = {
  1195. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1196. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x00,
  1197. X   0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
  1198. X   0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc2, 0x61, 0x00, 0x03,
  1199. X   0x00, 0x00, 0x00, 0x20, 0xc2, 0x21, 0x80, 0x03, 0x00, 0x00, 0x1c, 0x40,
  1200. X   0xc0, 0x21, 0x80, 0x03, 0x00, 0x80, 0x30, 0x40, 0x80, 0x38, 0x80, 0x01,
  1201. X   0x00, 0x80, 0x09, 0xa3, 0x82, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x11, 0x02,
  1202. X   0xc2, 0x22, 0x40, 0x00, 0x00, 0x00, 0x86, 0x84, 0xc4, 0x00, 0x40, 0x00,
  1203. X   0x00, 0x00, 0x80, 0x14, 0xc6, 0x02, 0x50, 0x00, 0xc0, 0x00, 0x0c, 0x8a,
  1204. X   0xe9, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xa8, 0x18, 0xd3, 0x75, 0x02, 0x08,
  1205. X   0x80, 0x01, 0xe0, 0x04, 0x3e, 0x03, 0x01, 0x04, 0x00, 0x05, 0x10, 0x92,
  1206. X   0x8a, 0x0e, 0x06, 0x07, 0x00, 0x5c, 0x81, 0xf1, 0xef, 0x1b, 0x00, 0x02,
  1207. X   0x00, 0x18, 0x80, 0x0c, 0xcf, 0x0b, 0xa5, 0x00, 0x00, 0x60, 0x88, 0x17,
  1208. X   0xef, 0x07, 0x87, 0x00, 0x00, 0xa0, 0x21, 0x79, 0xc7, 0x55, 0x23, 0x00,
  1209. X   0x00, 0x90, 0x40, 0x3f, 0xeb, 0x1e, 0x07, 0x00, 0x00, 0x00, 0x40, 0x9f,
  1210. X   0xef, 0xbc, 0x17, 0x00, 0x00, 0xa4, 0x05, 0x9e, 0x2f, 0x71, 0x06, 0x00,
  1211. X   0x00, 0x08, 0x00, 0x6f, 0x5f, 0xbc, 0x02, 0x00, 0x00, 0x40, 0xf9, 0x3c,
  1212. X   0x01, 0xbf, 0x03, 0x00, 0x00, 0x00, 0xac, 0xb3, 0x5f, 0xfd, 0x03, 0x00,
  1213. X   0x00, 0x00, 0xfc, 0xbb, 0x4f, 0xa7, 0x0b, 0x10, 0x00, 0x00, 0xd7, 0xad,
  1214. X   0xc2, 0x9a, 0x0d, 0x04, 0x00, 0x40, 0xfb, 0xc9, 0x98, 0x79, 0x11, 0x19,
  1215. X   0x00, 0xc0, 0xfa, 0x8d, 0x18, 0xcb, 0x3b, 0x02, 0x00, 0x80, 0xdd, 0x0d,
  1216. X   0x88, 0x0b, 0x5f, 0x08, 0x00, 0xc0, 0x2d, 0x39, 0x60, 0x1b, 0xfa, 0x00,
  1217. X   0x00, 0xd0, 0x7e, 0x97, 0xc1, 0x73, 0x58, 0x03, 0x00, 0x6b, 0xb1, 0x0e,
  1218. X   0x01, 0xfb, 0x1c, 0x02, 0x00, 0x80, 0xdf, 0x15, 0x81, 0x54, 0xec, 0x02,
  1219. X   0x00, 0x00, 0xfe, 0xff, 0xa2, 0xd9, 0x3c, 0x00, 0x00, 0x80, 0x7f, 0xde,
  1220. X   0xc2, 0xac, 0xb4, 0x02, 0x00, 0x00, 0x33, 0xde, 0xec, 0x0b, 0x3e, 0x02,
  1221. X   0x00, 0xc0, 0x6c, 0x17, 0xe1, 0xe7, 0xbc, 0x03, 0x00, 0x50, 0x76, 0xfd,
  1222. X   0xf7, 0xfe, 0xff, 0x00, 0x00, 0x1c, 0x5d, 0x9c, 0xfa, 0xba, 0xe9, 0x00,
  1223. X   0x00, 0x05, 0x63, 0xcc, 0x0e, 0xec, 0x99, 0x00, 0x00, 0x46, 0x82, 0x94,
  1224. X   0x80, 0xff, 0x3a, 0x00, 0x80, 0x03, 0xe3, 0xd7, 0x89, 0xcb, 0x27, 0x00,
  1225. X   0x00, 0x80, 0x21, 0x8f, 0x84, 0xc9, 0x3f, 0x00, 0x00, 0x00, 0x04, 0xff,
  1226. X   0xcc, 0xdb, 0xe3, 0x01, 0x00, 0xa0, 0x00, 0xa6, 0x7e, 0x0b, 0xb1, 0x07,
  1227. X   0x00, 0x00, 0x00, 0x19, 0x6f, 0x6e, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x9c,
  1228. X   0xfa, 0x53, 0x06, 0x02, 0x00, 0x00, 0x00, 0x04, 0xe7, 0xa9, 0x00, 0x06,
  1229. X   0x00, 0x00, 0x80, 0x43, 0x14, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
  1230. X   0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x0c, 0x40, 0x00, 0x00,
  1231. X   0x00, 0x00, 0x40, 0x05, 0x08, 0x20, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00,
  1232. X   0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x03, 0x00,
  1233. X   0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00,
  1234. X   0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00,
  1235. X   0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x14, 0x00,
  1236. X   0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x30, 0x00,
  1237. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00};
  1238. END_OF_FILE
  1239. if test 3272 -ne `wc -c <'acm/fsim/exp.xbm'`; then
  1240.     echo shar: \"'acm/fsim/exp.xbm'\" unpacked with wrong size!
  1241. fi
  1242. # end of 'acm/fsim/exp.xbm'
  1243. fi
  1244. if test -f 'acm/fsim/exp1.xbm' -a "${1}" != "-c" ; then 
  1245.   echo shar: Will not clobber existing file \"'acm/fsim/exp1.xbm'\"
  1246. else
  1247. echo shar: Extracting \"'acm/fsim/exp1.xbm'\" \(3319 characters\)
  1248. sed "s/^X//" >'acm/fsim/exp1.xbm' <<'END_OF_FILE'
  1249. X#define exp1_width 64
  1250. X#define exp1_height 64
  1251. X#define exp1_x_hot -1
  1252. X#define exp1_y_hot -1
  1253. Xstatic char exp1_bits[] = {
  1254. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
  1255. X   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x81, 0x00, 0x00, 0x00,
  1256. X   0x00, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
  1257. X   0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x80, 0x61, 0x00, 0x03,
  1258. X   0x00, 0x00, 0x00, 0x20, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
  1259. X   0x80, 0x20, 0x80, 0x01, 0x00, 0x80, 0x40, 0x40, 0x80, 0x38, 0x80, 0x01,
  1260. X   0x00, 0x80, 0x01, 0xa0, 0x82, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00,
  1261. X   0x82, 0x22, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0xc4, 0x00, 0x00, 0x00,
  1262. X   0x00, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00, 0x80, 0x00, 0x0c, 0x80,
  1263. X   0xa9, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0x10, 0x93, 0x75, 0x02, 0x20,
  1264. X   0x00, 0x00, 0xe0, 0x04, 0x3e, 0x03, 0x01, 0x20, 0x00, 0x04, 0x10, 0x92,
  1265. X   0x8a, 0x0e, 0x06, 0x1a, 0x00, 0x5c, 0x81, 0xf1, 0xef, 0x1b, 0x80, 0x01,
  1266. X   0x00, 0x18, 0x80, 0x0c, 0xcb, 0x01, 0xa5, 0x00, 0x00, 0x60, 0x88, 0x17,
  1267. X   0x43, 0x07, 0x87, 0x00, 0x00, 0xa0, 0x21, 0x79, 0xc7, 0x51, 0x23, 0x00,
  1268. X   0x00, 0x80, 0x40, 0x3f, 0xeb, 0x1e, 0x07, 0x00, 0x00, 0x00, 0x40, 0x1f,
  1269. X   0xef, 0xb8, 0x17, 0x00, 0x00, 0x04, 0x04, 0x06, 0x2c, 0x71, 0x06, 0x00,
  1270. X   0x00, 0x08, 0x00, 0x6b, 0x5f, 0x10, 0x02, 0x00, 0x00, 0x40, 0xf9, 0x38,
  1271. X   0x01, 0xbf, 0x01, 0x00, 0x00, 0x00, 0xac, 0xb3, 0x5f, 0xfd, 0x03, 0x00,
  1272. X   0x00, 0x00, 0xfc, 0xb9, 0x4f, 0xa7, 0x03, 0x10, 0x00, 0x00, 0xd7, 0xac,
  1273. X   0xc2, 0x9a, 0x0d, 0x04, 0x10, 0x40, 0x7b, 0xc9, 0x98, 0x79, 0x11, 0x18,
  1274. X   0x00, 0xc0, 0xfa, 0x8d, 0x18, 0xcb, 0x29, 0x02, 0x00, 0x80, 0xd8, 0x0d,
  1275. X   0x88, 0x0b, 0x57, 0x08, 0x00, 0xc0, 0x0c, 0x39, 0x60, 0x1b, 0x00, 0x00,
  1276. X   0x00, 0xd0, 0x64, 0x97, 0xc1, 0x73, 0x18, 0x03, 0x00, 0x6b, 0x81, 0x0e,
  1277. X   0x01, 0xfb, 0x0c, 0x02, 0x00, 0x80, 0xdf, 0x15, 0x81, 0x54, 0xe8, 0x02,
  1278. X   0x00, 0x00, 0xde, 0xff, 0xa2, 0xd9, 0x3c, 0x00, 0x00, 0x80, 0x3f, 0xde,
  1279. X   0xc2, 0xac, 0x94, 0x00, 0x00, 0x00, 0x33, 0xde, 0xec, 0x0b, 0x1e, 0x02,
  1280. X   0x00, 0xc0, 0x6c, 0x17, 0xe1, 0xe7, 0x1c, 0x02, 0x00, 0x50, 0x76, 0xfc,
  1281. X   0xf7, 0xfe, 0x3f, 0x00, 0x00, 0x1c, 0x5d, 0x9c, 0xfa, 0xba, 0x09, 0x00,
  1282. X   0x00, 0x04, 0x63, 0xcc, 0x0e, 0x8c, 0x89, 0x00, 0x00, 0x46, 0x82, 0x90,
  1283. X   0x80, 0xbb, 0x12, 0x00, 0x00, 0x02, 0xe3, 0xd7, 0x89, 0x81, 0x23, 0x00,
  1284. X   0x80, 0x81, 0x21, 0x83, 0x84, 0x89, 0x03, 0x00, 0x00, 0x00, 0x04, 0xf7,
  1285. X   0xcc, 0xdb, 0xe3, 0x00, 0x20, 0xa0, 0x00, 0xa6, 0x7e, 0x0b, 0xb1, 0x01,
  1286. X   0x20, 0x00, 0x00, 0x19, 0x6f, 0x4e, 0x8e, 0x00, 0x10, 0x00, 0x00, 0x1c,
  1287. X   0xe0, 0x53, 0x06, 0x02, 0x00, 0x00, 0x00, 0x04, 0xe7, 0xa9, 0x00, 0x02,
  1288. X   0x00, 0x00, 0x80, 0x43, 0x14, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
  1289. X   0x00, 0x88, 0x00, 0x0c, 0x00, 0x00, 0xc0, 0x00, 0x0c, 0x40, 0x00, 0x08,
  1290. X   0x00, 0x00, 0x40, 0x05, 0x08, 0x20, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00,
  1291. X   0x04, 0x00, 0x02, 0x18, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x03, 0x10,
  1292. X   0x00, 0x01, 0x20, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x08, 0x08, 0x00,
  1293. X   0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
  1294. X   0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
  1295. X   0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x10, 0x00,
  1296. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00};
  1297. END_OF_FILE
  1298. if test 3319 -ne `wc -c <'acm/fsim/exp1.xbm'`; then
  1299.     echo shar: \"'acm/fsim/exp1.xbm'\" unpacked with wrong size!
  1300. fi
  1301. # end of 'acm/fsim/exp1.xbm'
  1302. fi
  1303. if test -f 'acm/fsim/f16' -a "${1}" != "-c" ; then 
  1304.   echo shar: Will not clobber existing file \"'acm/fsim/f16'\"
  1305. else
  1306. echo shar: Extracting \"'acm/fsim/f16'\" \(3135 characters\)
  1307. sed "s/^X//" >'acm/fsim/f16' <<'END_OF_FILE'
  1308. XF-16-fighter
  1309. X130 12
  1310. X1 -18.165 0 0
  1311. X2 -18.165 -1.191 0
  1312. X3 -15.187 -2.085 0
  1313. X4 -13.698 -2.382 0
  1314. X5 -17.272 -2.382 0
  1315. X6 -17.272 -3.573 0
  1316. X7 -10.923 -3.573 0
  1317. X8 -4.169 -3.573 0
  1318. X9 -4.169 -4.765 0
  1319. X10 5.598 -4.765 0
  1320. X11 18.463 -2.144 0
  1321. X12 18.939 -1.787 0
  1322. X13 22.274 -1.489 0
  1323. X14 24.895 -1.191 0
  1324. X15 27.992 0 0
  1325. X16 -6.551 -3.573 0
  1326. X17 -6.551 -15.485 0
  1327. X18 0.357 -15.485 0
  1328. X19 0.357 -15.187 0
  1329. X20 -2.978 -15.008 0
  1330. X21 5.598 -4.765 0
  1331. X22 -4.169 -4.765 0
  1332. X23 -4.169 -3.573 0
  1333. X24 -17.272 -3.573 0
  1334. X25 -17.272 -8.934 0.893
  1335. X26 -15.187 -8.934 0.893
  1336. X27 -10.923 -3.573 0
  1337. X28 27.992 0 0
  1338. X29 24.895 1.191 0
  1339. X30 22.274 1.489 0
  1340. X31 18.939 1.787 0
  1341. X32 18.463 2.144 0
  1342. X33 5.598 4.765 0
  1343. X34 -4.169 4.765 0
  1344. X35 -4.169 3.573 0
  1345. X36 -10.923 3.573 0
  1346. X37 -17.272 3.573 0
  1347. X38 -17.272 2.382 0
  1348. X39 -13.698 2.382 0
  1349. X40 -15.187 2.085 0
  1350. X41 -18.165 1.191 0
  1351. X42 -18.165 0 0
  1352. X43 5.598 4.765 0
  1353. X44 -2.978 15.008 0
  1354. X45 0.357 15.187 0
  1355. X46 0.357 15.485 0
  1356. X47 -6.551 15.485 0
  1357. X48 -6.551 3.573 0
  1358. X49 -4.169 3.573 0
  1359. X50 -4.169 4.765 0
  1360. X51 -10.923 3.573 0
  1361. X52 -15.187 8.934 0.893
  1362. X53 -17.272 8.934 0.893
  1363. X54 -17.272 3.573 0
  1364. X55 27.992 0 0
  1365. X56 23.525 0 -1.191
  1366. X57 17.272 0 -2.382
  1367. X58 15.783 0 -3.812
  1368. X59 13.996 0 -4.169
  1369. X60 11.316 0 -4.05
  1370. X61 8.338 0 -3.335
  1371. X62 1.787 0 -2.382
  1372. X63 -4.169 0 -2.382
  1373. X64 -13.936 0 -1.906
  1374. X65 -15.128 0 -1.906
  1375. X66 -15.187 0 -1.787
  1376. X67 -18.165 0 -1.191
  1377. X68 -18.165 0 0
  1378. X69 -4.169 0 -2.382
  1379. X70 -10.125 0 -4.05
  1380. X71 -15.783 0 -10.482
  1381. X72 -19.654 0 -10.482
  1382. X73 -19.654 0 -9.529
  1383. X74 -19.654 0 -9.529
  1384. X75 -16.378 0 -3.573
  1385. X76 -16.378 0 -2.144
  1386. X77 -14.889 0 -2.382
  1387. X78 -13.936 0 -2.382
  1388. X79 -13.936 0 -1.906
  1389. X80 -18.165 0 0
  1390. X81 -18.165 0 1.191
  1391. X82 -15.187 0 2.085
  1392. X83 -13.698 0 2.263
  1393. X84 -2.68 0 2.382
  1394. X85 8.04 0 2.382
  1395. X86 12.507 0 2.263
  1396. X87 12.507 0 0.596
  1397. X88 19.952 0 0.596
  1398. X89 23.525 0 0.476
  1399. X90 27.992 0 0
  1400. X91 -3.551 0 -2.382
  1401. X92 -3.551 -3.871 -0.10
  1402. X93 -3.551 -15.485 0
  1403. X94 -3.551 -15.485 0.1065
  1404. X95 -3.551 -3.871 0.142
  1405. X96 -3.551 -2.58 0.2556
  1406. X97 -3.551 -2.387 1.818
  1407. X98 -3.551 -2.102 2.015
  1408. X99 -3.551 -1.03 2.251
  1409. X100 -3.551 0 2.282
  1410. X101 -3.551 1.03 2.251
  1411. X102 -3.551 2.102 2.015
  1412. X103 -3.551 2.387 1.818
  1413. X104 -3.551 2.58 0.2556
  1414. X105 -3.551 3.871 0.142
  1415. X106 -3.551 15.485 0.1065
  1416. X107 -3.551 15.485 0
  1417. X108 -3.551 3.871 -0.10
  1418. X109 13.996 0 -4.169
  1419. X110 13.996 -0.8932 -3.692
  1420. X111 13.996 -1.191 -2.978
  1421. X112 13.996 -1.251 -2.502
  1422. X113 13.996 -1.787 -1.311
  1423. X114 13.996 -3.054 0
  1424. X115 13.996 -1.583 0.3568
  1425. X116 13.996 0 0.596
  1426. X117 13.996 1.583 0.3568
  1427. X118 13.996 3.054 0
  1428. X119 13.996 1.787 -1.311
  1429. X120 13.996 1.251 -2.502
  1430. X121 13.996 1.191 -2.978
  1431. X122 13.996 0.8932 -3.692
  1432. X123 -18.165 1.191 0
  1433. X124 -18.165 0.842 0.842
  1434. X125 -18.165 0 1.191
  1435. X126 -18.165 -0.842 0.842
  1436. X127 -18.165 -1.191 0
  1437. X128 -18.165 -0.842 -0.842
  1438. X129 -18.165 0 -1.191
  1439. X130 -18.165 0.842 -0.842
  1440. Xgray44 14 109 110 111 112 113 114 115 116 117 118 119 120 121 122
  1441. Xgray44 18 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
  1442. Xgray44 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  1443. Xgray44 8 16 17 18 19 20 21 22 23
  1444. Xgray44 4 24 25 26 27
  1445. Xgray44 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  1446. Xgray44 8 43 44 45 46 47 48 49 50
  1447. Xgray44 4 51 52 53 54
  1448. Xgray44 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
  1449. Xgray44 11 69 70 71 72 73 74 75 76 77 78 79
  1450. Xgray44 11 80 81 82 83 84 85 86 87 88 89 90
  1451. Xgray44 8 123 124 125 126 127 128 129 130
  1452. END_OF_FILE
  1453. if test 3135 -ne `wc -c <'acm/fsim/f16'`; then
  1454.     echo shar: \"'acm/fsim/f16'\" unpacked with wrong size!
  1455. fi
  1456. # end of 'acm/fsim/f16'
  1457. fi
  1458. if test -f 'acm/fsim/flaps.c' -a "${1}" != "-c" ; then 
  1459.   echo shar: Will not clobber existing file \"'acm/fsim/flaps.c'\"
  1460. else
  1461. echo shar: Extracting \"'acm/fsim/flaps.c'\" \(2198 characters\)
  1462. sed "s/^X//" >'acm/fsim/flaps.c' <<'END_OF_FILE'
  1463. X/*
  1464. X *    xflight : an aerial combat simulator for X
  1465. X *
  1466. X *    Written by Riley Rainey,  riley@mips.com
  1467. X *
  1468. X *    Permission to use, copy, modify and distribute (without charge) this
  1469. X *    software, documentation, images, etc. is granted, provided that this 
  1470. X *    comment and the author's name is retained.
  1471. X *
  1472. X */
  1473. X#include "pm.h"
  1474. X
  1475. Xint    flapsDown (c)
  1476. Xcraft    *c; {
  1477. X
  1478. X    c->flapSetting += 10.0 * pi / 180.0;
  1479. X    if (c->flapSetting > c->cinfo->maxFlap)
  1480. X        c->flapSetting = c->cinfo->maxFlap;
  1481. X    return 0;
  1482. X}
  1483. X
  1484. Xint    flapsUp (c)
  1485. Xcraft    *c; {
  1486. X
  1487. X    c->flapSetting -= 10.0 * pi / 180.0;
  1488. X    if (c->flapSetting < 0.0)
  1489. X        c->flapSetting = 0.0;
  1490. X    return 0;
  1491. X}
  1492. X
  1493. Xvoid    flapControl (c)
  1494. Xcraft    *c; {
  1495. X
  1496. X    if (isFunctioning(c, SYS_FLAPS)) {
  1497. X
  1498. X        if (c->flapSetting > c->curFlap) {
  1499. X        c->curFlap += c->cinfo->flapRate * deltaT;
  1500. X        if (c->curFlap > c->flapSetting)
  1501. X            c->curFlap = c->flapSetting;
  1502. X        }
  1503. X        else if (c->flapSetting < c->curFlap) {
  1504. X        c->curFlap -= c->cinfo->flapRate * deltaT;
  1505. X        if (c->curFlap < c->flapSetting)
  1506. X            c->curFlap = c->flapSetting;
  1507. X        }
  1508. X    }
  1509. X
  1510. X    if (isFunctioning(c, SYS_SPEEDBRAKE)) {
  1511. X
  1512. X        if (c->speedBrakeSetting > c->curSpeedBrake) {
  1513. X        c->curSpeedBrake += c->cinfo->speedBrakeRate * deltaT;
  1514. X        if (c->curSpeedBrake > c->speedBrakeSetting)
  1515. X            c->curSpeedBrake = c->speedBrakeSetting;
  1516. X        }
  1517. X        else if (c->speedBrakeSetting < c->curSpeedBrake) {
  1518. X        c->curSpeedBrake -= c->cinfo->speedBrakeRate * deltaT;
  1519. X        if (c->curSpeedBrake < c->speedBrakeSetting)
  1520. X            c->curSpeedBrake = c->speedBrakeSetting;
  1521. X        }
  1522. X    }
  1523. X
  1524. X/*
  1525. X *  Set some status flags
  1526. X */
  1527. X
  1528. X    if (c->fuel < 1000.0)
  1529. X        c->damageBits &= ~FLAG_LOWFUEL;
  1530. X    else
  1531. X        c->damageBits |= FLAG_LOWFUEL;
  1532. X
  1533. X    if (c->flags & FL_BRAKES)
  1534. X        c->damageBits &= ~FLAG_WHEELBRAKE;
  1535. X    else
  1536. X        c->damageBits |= FLAG_WHEELBRAKE;
  1537. X
  1538. X    if (c->speedBrakeSetting > 0.0)
  1539. X        c->damageBits &= ~FLAG_SPEEDBRAKE;
  1540. X    else
  1541. X        c->damageBits |= FLAG_SPEEDBRAKE;
  1542. X}
  1543. X
  1544. Xint    speedBrakeExtend (c)
  1545. Xcraft    *c; {
  1546. X
  1547. X    c->speedBrakeSetting += c->cinfo->speedBrakeIncr;
  1548. X    if (c->speedBrakeSetting > c->cinfo->maxSpeedBrake)
  1549. X        c->speedBrakeSetting = c->cinfo->maxSpeedBrake;
  1550. X    return 0;
  1551. X}
  1552. X
  1553. Xint    speedBrakeRetract (c)
  1554. Xcraft    *c; {
  1555. X
  1556. X    c->speedBrakeSetting -= c->cinfo->speedBrakeIncr;
  1557. X    if (c->speedBrakeSetting < 0.0)
  1558. X        c->speedBrakeSetting = 0.0;
  1559. X    return 0;
  1560. X}
  1561. END_OF_FILE
  1562. if test 2198 -ne `wc -c <'acm/fsim/flaps.c'`; then
  1563.     echo shar: \"'acm/fsim/flaps.c'\" unpacked with wrong size!
  1564. fi
  1565. # end of 'acm/fsim/flaps.c'
  1566. fi
  1567. if test -f 'acm/fsim/flaps1.xbm' -a "${1}" != "-c" ; then 
  1568.   echo shar: Will not clobber existing file \"'acm/fsim/flaps1.xbm'\"
  1569. else
  1570. echo shar: Extracting \"'acm/fsim/flaps1.xbm'\" \(1730 characters\)
  1571. sed "s/^X//" >'acm/fsim/flaps1.xbm' <<'END_OF_FILE'
  1572. X#define flaps1_width 64
  1573. X#define flaps1_height 32
  1574. X#define flaps1_x_hot -1
  1575. X#define flaps1_y_hot -1
  1576. Xstatic char flaps1_bits[] = {
  1577. X   0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xde, 0xdd, 0xfd,
  1578. X   0x1f, 0x00, 0x00, 0x00, 0x60, 0xef, 0xee, 0xee, 0xee, 0xff, 0x03, 0x00,
  1579. X   0x70, 0x77, 0x77, 0x77, 0x77, 0xf7, 0x3f, 0x00, 0x58, 0xbb, 0xbb, 0xbb,
  1580. X   0xbb, 0x7b, 0x01, 0x00, 0x48, 0xdf, 0xdd, 0xdd, 0xdd, 0x3d, 0x0f, 0x00,
  1581. X   0xe8, 0xfe, 0xff, 0xff, 0xff, 0x9f, 0x3f, 0x00, 0x38, 0x00, 0x00, 0x00,
  1582. X   0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07,
  1583. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00,
  1584. X   0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1585. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1586. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1587. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1588. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1589. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1590. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1591. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1592. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1593. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1594. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1595. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1596. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1597. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1598. X   0x00, 0x00, 0x00, 0x00};
  1599. END_OF_FILE
  1600. if test 1730 -ne `wc -c <'acm/fsim/flaps1.xbm'`; then
  1601.     echo shar: \"'acm/fsim/flaps1.xbm'\" unpacked with wrong size!
  1602. fi
  1603. # end of 'acm/fsim/flaps1.xbm'
  1604. fi
  1605. if test -f 'acm/fsim/init.c' -a "${1}" != "-c" ; then 
  1606.   echo shar: Will not clobber existing file \"'acm/fsim/init.c'\"
  1607. else
  1608. echo shar: Extracting \"'acm/fsim/init.c'\" \(3350 characters\)
  1609. sed "s/^X//" >'acm/fsim/init.c' <<'END_OF_FILE'
  1610. X/*
  1611. X *    xflight : an aerial combat simulator for X
  1612. X *
  1613. X *    Written by Riley Rainey,  riley@mips.com
  1614. X *
  1615. X *    Permission to use, copy, modify and distribute (without charge) this
  1616. X *    software, documentation, images, etc. is granted, provided that this 
  1617. X *    comment and the author's name is retained.
  1618. X *
  1619. X */
  1620. X#include <string.h>
  1621. X#include "pm.h"
  1622. X
  1623. Xextern craftType *newCraft();
  1624. Xextern void initaim9(), initm61a1();
  1625. Xextern void initf16(), initmig23();
  1626. X
  1627. XFILE *acm_fopen (name, access)
  1628. Xchar *name, *access; {
  1629. X
  1630. X    FILE    *f;
  1631. X    char    libname[256];
  1632. X
  1633. X    if ((f = fopen (name, access)) == (FILE *) NULL) {
  1634. X        strcpy (libname, ACM_LIBRARY);
  1635. X        strcat (libname, name);
  1636. X        return fopen (libname, access);
  1637. X    }
  1638. X
  1639. X    return f;
  1640. X}
  1641. X
  1642. Xint init () {
  1643. X
  1644. X    FILE    *f;
  1645. X    static    VObject    *o2;
  1646. X    int    i;
  1647. X    craft    *p;
  1648. X
  1649. X        for ((i=0, p=stbl); i<MAXSURFACE; (++i, ++p))
  1650. X        p->type = CT_FREE;
  1651. X
  1652. X        for ((i=0, p=ptbl); i<MAXPLAYERS; (++i, ++p)) {
  1653. X        p->index = i;
  1654. X        p->type = CT_FREE;
  1655. X    }
  1656. X
  1657. X        for ((i=0, p=mtbl); i<MAXPROJECTILES; (++i, ++p))
  1658. X        p->type = CT_FREE;
  1659. X
  1660. X/*    HUDColor = VAllocColor ("#ffc800"); */
  1661. X    HUDColor = VAllocColor ("white");
  1662. X/*    groundColor = VAllocColor ("#29350B"); */
  1663. X/*    groundColor = VAllocColor ("#717844"); */
  1664. X    groundColor = VAllocColor ("#879349");
  1665. X    whiteColor = VAllocColor ("white");
  1666. X    blackColor = VAllocColor ("black");
  1667. X
  1668. X/*
  1669. X * Read in the runway and place it.
  1670. X */
  1671. X
  1672. X    f = acm_fopen ("rwy", "r");
  1673. X    stbl[1].type = CT_SURFACE;
  1674. X    stbl[1].cinfo = newCraft();
  1675. X    stbl[1].cinfo->object = VReadObject(f);
  1676. X    fclose (f);
  1677. X    stbl[1].Sg.x = 0.0;
  1678. X    stbl[1].Sg.y = 0.0;
  1679. X    stbl[1].Sg.z = 0.0;
  1680. X    stbl[1].curHeading = stbl[1].curPitch = stbl[1].curRoll = 0.0;
  1681. X
  1682. X    f = acm_fopen ("rwy2", "r");
  1683. X    stbl[0].type = CT_SURFACE;
  1684. X    stbl[0].cinfo = newCraft();
  1685. X    stbl[0].cinfo->object = VReadObject(f);
  1686. X    fclose (f);
  1687. X    stbl[0].Sg.x = 4000.0;
  1688. X    stbl[0].Sg.y = 3000.0;
  1689. X    stbl[0].Sg.z = 0.0;
  1690. X    stbl[0].curHeading = 300.0 * 3.14159 / 180.0;
  1691. X    stbl[0].curPitch = stbl[0].curRoll = 0.0;
  1692. X
  1693. X    f = acm_fopen ("tower", "r");
  1694. X    stbl[2].type = CT_SURFACE;
  1695. X    stbl[2].cinfo = newCraft();
  1696. X    stbl[2].cinfo->object = VReadObject(f);
  1697. X    fclose (f);
  1698. X    stbl[2].Sg.x = 4000.0;
  1699. X    stbl[2].Sg.y = -700.0;
  1700. X    stbl[2].Sg.z = 0.0;
  1701. X    stbl[2].curHeading = stbl[2].curPitch = stbl[2].curRoll = 0.0;
  1702. X
  1703. X    f = acm_fopen ("mtn", "r");
  1704. X    stbl[3].type = CT_SURFACE;
  1705. X    stbl[3].cinfo = newCraft();
  1706. X    stbl[3].cinfo->object = VReadObject(f);
  1707. X    fclose (f);
  1708. X    stbl[3].Sg.x = 20.0 * NM;
  1709. X    stbl[3].Sg.y = 6.0 * NM;
  1710. X    stbl[3].Sg.z = 0.0;
  1711. X    stbl[3].curHeading = DEGtoRAD (30.0);
  1712. X    stbl[3].curPitch = stbl[3].curRoll = 0.0;
  1713. X
  1714. X    stbl[4].type = CT_SURFACE;
  1715. X    stbl[4].cinfo = stbl[3].cinfo;
  1716. X    stbl[4].Sg.x = -2.0 * NM;
  1717. X    stbl[4].Sg.y = 40.0 * NM;
  1718. X    stbl[4].Sg.z = 0.0;
  1719. X    stbl[4].curHeading = DEGtoRAD (160.0);
  1720. X    stbl[4].curPitch = stbl[4].curRoll = 0.0;
  1721. X
  1722. X    stbl[5].type = CT_SURFACE;
  1723. X    stbl[5].cinfo = stbl[3].cinfo;
  1724. X    stbl[5].Sg.x = -2.6 * NM;
  1725. X    stbl[5].Sg.y = 43.0 * NM;
  1726. X    stbl[5].Sg.z = 0.0;
  1727. X    stbl[5].curHeading = DEGtoRAD (160.0);
  1728. X    stbl[5].curPitch = stbl[4].curRoll = 0.0;
  1729. X
  1730. X    stbl[6].type = CT_SURFACE;
  1731. X    stbl[6].cinfo = stbl[1].cinfo;
  1732. X    stbl[6].Sg.x = -0.6 * NM;
  1733. X    stbl[6].Sg.y = 49.0 * NM;
  1734. X    stbl[6].Sg.z = 0.0;
  1735. X    stbl[6].curHeading = DEGtoRAD (0.0);
  1736. X    stbl[6].curPitch = stbl[6].curRoll = 0.0;
  1737. X
  1738. X    initf16();
  1739. X    initmig23();
  1740. X    initf16();
  1741. X    initmig23();
  1742. X    initaim9();
  1743. X    initm61a1();
  1744. X
  1745. X/*
  1746. X *  Set time intervals.
  1747. X */
  1748. X
  1749. X    deltaT = (double) UPDATE_INTERVAL / 1000000.0;
  1750. X
  1751. X    halfDeltaTSquared = 0.5 * deltaT * deltaT;
  1752. X
  1753. X    return 0;
  1754. X}
  1755. END_OF_FILE
  1756. if test 3350 -ne `wc -c <'acm/fsim/init.c'`; then
  1757.     echo shar: \"'acm/fsim/init.c'\" unpacked with wrong size!
  1758. fi
  1759. # end of 'acm/fsim/init.c'
  1760. fi
  1761. if test -f 'acm/fsim/mig23' -a "${1}" != "-c" ; then 
  1762.   echo shar: Will not clobber existing file \"'acm/fsim/mig23'\"
  1763. else
  1764. echo shar: Extracting \"'acm/fsim/mig23'\" \(2514 characters\)
  1765. sed "s/^X//" >'acm/fsim/mig23' <<'END_OF_FILE'
  1766. Xmig-23-wings-swept
  1767. X88 10
  1768. X1 36.5891 0 0
  1769. X2 34.4368 0.86092 0
  1770. X3 30.9931 1.29138 0
  1771. X4 27.119 1.72184 0
  1772. X5 20.6621 1.72184 0
  1773. X6 18.9402 2.1523 0
  1774. X7 14.2052 3.01322 0
  1775. X8 -3.44368 2.58276 0
  1776. X9 -9.03966 2.1523 0
  1777. X10 -16.7879 0.86092 0
  1778. X11 -18.0793 0.43046 0
  1779. X12 -18.0793 0 0
  1780. X13 36.5891 0 0
  1781. X14 34.4368 -0.86092 0
  1782. X15 30.9931 -1.29138 0
  1783. X16 27.119 -1.72184 0
  1784. X17 20.6621 -1.72184 0
  1785. X18 18.9402 -2.1523 0
  1786. X19 14.2052 -3.01322 0
  1787. X20 -3.44368 -2.58276 0
  1788. X21 -9.03966 -2.1523 0
  1789. X22 -16.7879 -0.86092 0
  1790. X23 -18.0793 -0.43046 0
  1791. X24 -18.0793 0 0
  1792. X25 14.2052 3.01322 -3.01322
  1793. X26 4.73506 7.31782 -3.01322
  1794. X27 6.02644 8.6092 -3.01322
  1795. X28 -11.192 13.7747 -3.01322
  1796. X29 -12.0529 13.7747 -3.01322
  1797. X30 -14.2052 11.192 -3.01322
  1798. X31 -14.2052 10.7615 -3.01322
  1799. X32 -3.44368 2.58276 -3.01322
  1800. X33 14.2052 -3.01322 -3.01322
  1801. X34 4.73506 -7.31782 -3.01322
  1802. X35 6.02644 -8.6092 -3.01322
  1803. X36 -11.192 -13.7747 -3.01322
  1804. X37 -12.0529 -13.7747 -3.01322
  1805. X38 -14.2052 -11.192 -3.01322
  1806. X39 -14.2052 -10.7615 -3.01322
  1807. X40 -3.44368 -2.58276 -3.01322
  1808. X41 -18.9402 3.01322 -1.72184
  1809. X42 -20.2316 7.31782 -1.72184
  1810. X43 -18.5098 8.6092 -1.72184
  1811. X44 -9.03966 2.1523 -1.72184
  1812. X45 -16.7879 0.86092 -1.72184
  1813. X46 -18.9402 -3.01322 -1.72184
  1814. X47 -20.2316 -7.31782 -1.72184
  1815. X48 -18.5098 -8.6092 -1.72184
  1816. X49 -9.03966 -2.1523 -1.72184
  1817. X50 -16.7879 -0.86092 -1.72184
  1818. X51 36.5891 0 0
  1819. X52 33.1454 0 -1.29138
  1820. X53 30.1322 0 -2.1523
  1821. X54 25.8276 0 -2.58276
  1822. X55 22.3839 0 -3.87414
  1823. X56 18.0793 0 -4.3046
  1824. X57 9.47012 0 -3.87414
  1825. X58 -0.860918 0 -3.44368
  1826. X59 -8.6092 0 -6.02644
  1827. X60 -16.3575 0 -10.331
  1828. X61 -18.9402 0 -9.03966
  1829. X62 -18.0793 0 -3.87414
  1830. X63 -19.8012 0 -3.44368
  1831. X64 -17.2184 0 -1.72184
  1832. X65 -18.0793 0 -1.72184
  1833. X66 -18.0793 0 1.29138
  1834. X67 -15.4966 0 1.72184
  1835. X68 -6.4569 0 2.1523
  1836. X69 10.331 0 2.1523
  1837. X70 20.2316 0 1.72184
  1838. X71 28.8408 0 1.29138
  1839. X72 33.1454 0 0.86092
  1840. X73 -15.4966 0 1.72184
  1841. X74 -15.4966 0 4.3046
  1842. X75 -13.3443 0 5.16552
  1843. X76 -6.4569 0 2.1523
  1844. X77 20.6621 1.72184 -3.01322
  1845. X78 18.9402 2.1523 -3.01322
  1846. X79 14.2052 3.01322 -3.01322
  1847. X80 -3.44368 2.58276 -3.01322
  1848. X81 -3.44368 -2.58276 -3.01322
  1849. X82 14.2052 -3.01322 -3.01322
  1850. X83 18.9402 -2.1523 -3.01322
  1851. X84 20.6621 -1.72184 -3.01322
  1852. X85 -3.44368 2.58276 -3.01322
  1853. X86 -16.7879 0.86092 -1.72184
  1854. X87 -16.7879 -0.86092 -1.72184
  1855. X88 -3.44368 -2.58276 -3.01322
  1856. Xgray44 12 1 2 3 4 5 6 7 8 9 10 11 12
  1857. Xgray44 12 13 14 15 16 17 18 19 20 21 22 23 24
  1858. Xgray44 8 25 26 27 28 29 30 31 32
  1859. Xgray44 8 33 34 35 36 37 38 39 40
  1860. Xgray44 5 41 42 43 44 45
  1861. Xgray44 5 46 47 48 49 50
  1862. Xgray44 22 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  1863. Xgray44 4 73 74 75 76
  1864. Xgray44 8 77 78 79 80 81 82 83 84
  1865. Xgray44 4 85 86 87 88
  1866. END_OF_FILE
  1867. if test 2514 -ne `wc -c <'acm/fsim/mig23'`; then
  1868.     echo shar: \"'acm/fsim/mig23'\" unpacked with wrong size!
  1869. fi
  1870. # end of 'acm/fsim/mig23'
  1871. fi
  1872. if test -f 'acm/fsim/missileCalc.c' -a "${1}" != "-c" ; then 
  1873.   echo shar: Will not clobber existing file \"'acm/fsim/missileCalc.c'\"
  1874. else
  1875. echo shar: Extracting \"'acm/fsim/missileCalc.c'\" \(2621 characters\)
  1876. sed "s/^X//" >'acm/fsim/missileCalc.c' <<'END_OF_FILE'
  1877. X/*
  1878. X *    xflight : an aerial combat simulator for X
  1879. X *
  1880. X *    Written by Riley Rainey,  riley@mips.com
  1881. X *
  1882. X *    Permission to use, copy, modify and distribute (without charge) this
  1883. X *    software, documentation, images, etc. is granted, provided that this 
  1884. X *    comment and the author's name is retained.
  1885. X *
  1886. X */
  1887. X#include <stdio.h>
  1888. X#include <math.h>
  1889. X#include "pm.h"
  1890. X
  1891. Xint mdebug = 0;
  1892. Xextern double calcRho();
  1893. Xextern void trackTarget();
  1894. Xextern void craftToGround();
  1895. X
  1896. Xint  missileCalculations (c)
  1897. Xcraft *c; {
  1898. X
  1899. X    double    q, rho;
  1900. X    double    FLift, FDrag, FWeight;
  1901. X    double    Vmag;
  1902. X    VPoint    F, Fg;
  1903. X    VMatrix mtx;
  1904. X
  1905. X/*
  1906. X *  Check for ground impact.  We do this at the beginning to permit us to
  1907. X *  kill ground targets.
  1908. X */
  1909. X
  1910. X    if (c->Sg.z > 0.0) {
  1911. X        killMissile (c);
  1912. X        return 1;
  1913. X    }
  1914. X
  1915. X    trackTarget (c);
  1916. X
  1917. X    -- c->armFuse;
  1918. X
  1919. X/*
  1920. X *  Re-orient the body of the missile towards it's intended target.
  1921. X */
  1922. X
  1923. X    c->prevSg = c->Sg;
  1924. X
  1925. X    rho = calcRho (-(c->Sg.z), &q);
  1926. X
  1927. X/*
  1928. X *  Compute the resultant force vector on the missile.
  1929. X */
  1930. X
  1931. X    Vmag = mag(c->Cg);
  1932. X    q = rho * c->cinfo->wingS * Vmag * Vmag * 0.5;
  1933. X    FLift = 0.0;
  1934. X    FDrag = c->cinfo->CDOrigin * q;
  1935. X
  1936. X    if (mdebug) {
  1937. X    printf ("rho = %g, FLift = %g, FDrag = %g\n", rho, FLift, FDrag);
  1938. X    printf ("FThrust = %g\n", c->curThrust);
  1939. X    }
  1940. X
  1941. X    F.x = c->curThrust - FDrag;
  1942. X    F.y = 0.0; 
  1943. X    F.z = 0.0; 
  1944. X
  1945. X/*
  1946. X *  Now calculate changes in position (Sg) and velocity (Cg).
  1947. X */
  1948. X
  1949. X    if ((c->fuel -= fuelUsed(c)) <= 0.0) {
  1950. X        if (c->curThrust > 0.0)
  1951. X            if (mdebug)
  1952. X            printf ("Missile burnout; velocity = %g fps (%g kts)\n", Vmag,
  1953. X                FPStoKTS(Vmag));
  1954. X        c->fuel = 0.0;
  1955. X        c->curThrust = 0.0;
  1956. X    }
  1957. X
  1958. X/*
  1959. X *  The missile's trihedral and Itrihedral matrices are managed by 
  1960. X *  trackTarget().
  1961. X */
  1962. X
  1963. X    craftToGround (c, &F, &Fg);
  1964. X    FWeight = c->cinfo->emptyWeight + c->fuel;
  1965. X    Fg.z += FWeight;
  1966. X
  1967. X    if (mdebug) {
  1968. X            printf ("v = %g kts, Fg = { %g, %g, %g }\n", FPStoKTS(Vmag),
  1969. X            Fg.x, Fg.y, Fg.z);
  1970. X            printf ("F = { %g, %g, %g }\n", F.x, F.y, F.z);
  1971. X    }
  1972. X
  1973. X
  1974. X
  1975. X/*
  1976. X *  Update the missile's position and velocity.
  1977. X */
  1978. X
  1979. X
  1980. X    c->Sg.x += c->Cg.x * deltaT + Fg.x / FWeight * a * halfDeltaTSquared;
  1981. X    c->Sg.y += c->Cg.y * deltaT + Fg.y / FWeight * a * halfDeltaTSquared;
  1982. X    c->Sg.z += c->Cg.z * deltaT + Fg.z / FWeight * a * halfDeltaTSquared;
  1983. X
  1984. X    c->Cg.x += Fg.x / FWeight * a * deltaT;
  1985. X    c->Cg.y += Fg.y / FWeight * a * deltaT;
  1986. X    c->Cg.z += Fg.z / FWeight * a * deltaT;
  1987. X
  1988. X
  1989. X    if (mdebug) {
  1990. X        printf ("Altitude = %g\n", -c->Sg.z);
  1991. X        printf ("Euler angles { %g, %g, %g }\n", RADtoDEG(c->curRoll),
  1992. X            RADtoDEG(c->curPitch), RADtoDEG(c->curHeading));
  1993. X        printf ("Cg = { %g, %g, %g }\n", c->Cg.x, c->Cg.y, c->Cg.z);
  1994. X        printf ("Sg = { %g, %g, %g }\n", c->Sg.x, c->Sg.y, c->Sg.z);
  1995. X    }
  1996. X
  1997. X    return 0;
  1998. X}
  1999. END_OF_FILE
  2000. if test 2621 -ne `wc -c <'acm/fsim/missileCalc.c'`; then
  2001.     echo shar: \"'acm/fsim/missileCalc.c'\" unpacked with wrong size!
  2002. fi
  2003. # end of 'acm/fsim/missileCalc.c'
  2004. fi
  2005. if test -f 'acm/fsim/panel.c' -a "${1}" != "-c" ; then 
  2006.   echo shar: Will not clobber existing file \"'acm/fsim/panel.c'\"
  2007. else
  2008. echo shar: Extracting \"'acm/fsim/panel.c'\" \(1940 characters\)
  2009. sed "s/^X//" >'acm/fsim/panel.c' <<'END_OF_FILE'
  2010. X/*
  2011. X *    xflight : an aerial combat simulator for X
  2012. X *
  2013. X *    Written by Riley Rainey,  riley@mips.com
  2014. X *
  2015. X *    Permission to use, copy, modify and distribute (without charge) this
  2016. X *    software, documentation, images, etc. is granted, provided that this 
  2017. X *    comment and the author's name is retained.
  2018. X *
  2019. X */
  2020. X
  2021. X#include "pm.h"
  2022. X
  2023. Xstatic struct {
  2024. X    long    mask;
  2025. X    char    *name;
  2026. X    }    *pptr, panelVec[] = {
  2027. X    SYS_ENGINE1,    "OIL PRES",
  2028. X    SYS_HYD1,    "HYD1 PRES",
  2029. X    SYS_HYD2,    "HYD2 PRES",
  2030. X    SYS_GEN1,    "GEN1 FAIL",
  2031. X    SYS_GEN2,    "GEN2 FAIL",
  2032. X    SYS_FLAPS,    "FLAP FAIL",
  2033. X    SYS_SPEEDBRAKE, "SPBRK FAIL",
  2034. X    SYS_RADAR,    "RADAR FAIL",
  2035. X    SYS_TEWS,    "TEWS FAIL",
  2036. X    SYS_HUD,    " HUD FAIL",
  2037. X    FLAG_LOWFUEL,    " LOW FUEL",
  2038. X    FLAG_SPEEDBRAKE, "SPD BRAKE",
  2039. X    FLAG_WHEELBRAKE, "  BRAKES",
  2040. X    0,        (char *) 0 };
  2041. X
  2042. X#define panelRows    7
  2043. X#define panelChars    10
  2044. X#define lightMargin    ((u->rftw + 1) / 3)    
  2045. X#define panelWMargin    (u->rftw * 2)
  2046. X#define panelHMargin    (u->rfth / 2)
  2047. X
  2048. Xlong    lastBits[MAXPLAYERS];
  2049. X
  2050. Xvoid    initPanel (c)
  2051. Xcraft    *c; {
  2052. X
  2053. X    lastBits [c->index] = SYS_NODAMAGE;
  2054. X
  2055. X}
  2056. X
  2057. Xvoid doPanel (c, u)
  2058. Xcraft    *c;
  2059. Xviewer    *u; {
  2060. X
  2061. X    int    cellH, cellW;
  2062. X    int    xi, yi, x, y, i;
  2063. X    long    changeBits;
  2064. X
  2065. X    cellH = u->rfth + 2 * lightMargin + panelHMargin;
  2066. X    cellW = u->rftw * panelChars + 2 * lightMargin + panelWMargin;
  2067. X
  2068. X    XSetForeground (u->dpy, u->gc, WhitePixel(u->v->dpy, u->v->screen));
  2069. X
  2070. X    changeBits = lastBits[c->index] ^ c->damageBits;
  2071. X
  2072. X    for (pptr = &panelVec[0], i=0; pptr->mask != 0; ++pptr, ++i) {
  2073. X        if (changeBits & pptr->mask) {
  2074. X            xi = i / panelRows;
  2075. X            yi = i % panelRows;
  2076. X            x = u->scaleFactor * PANEL_X + 0.5;
  2077. X            x += xi * cellW + lightMargin;
  2078. X            y = u->scaleFactor * PANEL_Y + 0.5;
  2079. X            y += yi * cellH + lightMargin;
  2080. X            if ((c->damageBits & pptr->mask) == 0) 
  2081. X                XDrawImageString (u->dpy, u->win, u->gc,
  2082. X                    x, y, pptr->name, strlen(pptr->name));
  2083. X            else {
  2084. X                y -= u->rfth;
  2085. X                XClearArea (u->dpy, u->win, x, y,
  2086. X                    u->rftw * panelChars,
  2087. X                    u->rfth + lightMargin, False);
  2088. X            }
  2089. X        }
  2090. X    }
  2091. X
  2092. X    lastBits[c->index] = c->damageBits;
  2093. X}
  2094. END_OF_FILE
  2095. if test 1940 -ne `wc -c <'acm/fsim/panel.c'`; then
  2096.     echo shar: \"'acm/fsim/panel.c'\" unpacked with wrong size!
  2097. fi
  2098. # end of 'acm/fsim/panel.c'
  2099. fi
  2100. echo shar: End of archive 2 \(of 9\).
  2101. cp /dev/null ark2isdone
  2102. MISSING=""
  2103. for I in 1 2 3 4 5 6 7 8 9 ; do
  2104.     if test ! -f ark${I}isdone ; then
  2105.     MISSING="${MISSING} ${I}"
  2106.     fi
  2107. done
  2108. if test "${MISSING}" = "" ; then
  2109.     echo You have unpacked all 9 archives.
  2110.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2111. else
  2112.     echo You still need to unpack the following archives:
  2113.     echo "        " ${MISSING}
  2114. fi
  2115. ##  End of shell archive.
  2116. exit 0
  2117. -- 
  2118. Riley Rainey            Internet: riley@mips.com
  2119. MIPS Computer Systems        Phone:    +1 214 770-7979
  2120. Dallas, Texas
  2121.